From 04402dd6cc8f42ff0f5123f15a9dc10e8d59a136 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 4 Jul 2009 15:44:33 +0000 Subject: [PATCH] * initialize allow_array_constructor for each compilation run, fixes probably #12283 git-svn-id: trunk@13360 - --- compiler/htypechk.pas | 3 ++- compiler/nld.pas | 2 +- compiler/parser.pas | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/htypechk.pas b/compiler/htypechk.pas index 2c6f321230..eed7f32ebd 100644 --- a/compiler/htypechk.pas +++ b/compiler/htypechk.pas @@ -122,7 +122,8 @@ interface (tok:_ASSIGNMENT;nod:assignn;op_overloading_supported:true), { unary overloading supported } (tok:_UNEQUAL ;nod:unequaln;op_overloading_supported:false) { binary overloading NOT supported overload = instead } ); - const + + { true, if we are parsing stuff which allows array constructors } allow_array_constructor : boolean = false; function node2opstr(nt:tnodetype):string; diff --git a/compiler/nld.pas b/compiler/nld.pas index 68136ed5be..1f90d17dea 100644 --- a/compiler/nld.pas +++ b/compiler/nld.pas @@ -837,7 +837,7 @@ implementation Do this only if we didn't convert the arrayconstructor yet. This is needed for the cases where the resultdef is forced for a second run } - if (not allow_array_constructor) then + if not(allow_array_constructor) then begin hp:=tarrayconstructornode(getcopy); arrayconstructor_to_set(tnode(hp)); diff --git a/compiler/parser.pas b/compiler/parser.pas index c9b3e05adb..59384f9cd1 100644 --- a/compiler/parser.pas +++ b/compiler/parser.pas @@ -49,7 +49,7 @@ implementation script,gendef, comphook, scanner,scandir, - pbase,ptype,psystem,pmodules,psub,ncgrtti, + pbase,ptype,psystem,pmodules,psub,ncgrtti,htypechk, cresstr,cpuinfo,procinfo; @@ -337,6 +337,7 @@ implementation named_args_allowed:=false; got_addrn:=false; getprocvardef:=nil; + allow_array_constructor:=false; { show info } Message1(parser_i_compiling,filename);