Explorar o código

* initialize allow_array_constructor for each compilation run, fixes probably #12283

git-svn-id: trunk@13360 -
florian %!s(int64=16) %!d(string=hai) anos
pai
achega
04402dd6cc
Modificáronse 3 ficheiros con 5 adicións e 3 borrados
  1. 2 1
      compiler/htypechk.pas
  2. 1 1
      compiler/nld.pas
  3. 2 1
      compiler/parser.pas

+ 2 - 1
compiler/htypechk.pas

@@ -122,7 +122,8 @@ interface
         (tok:_ASSIGNMENT;nod:assignn;op_overloading_supported:true), { unary overloading supported }
         (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 }
         (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;
       allow_array_constructor : boolean = false;
 
 
     function node2opstr(nt:tnodetype):string;
     function node2opstr(nt:tnodetype):string;

+ 1 - 1
compiler/nld.pas

@@ -837,7 +837,7 @@ implementation
         Do this only if we didn't convert the arrayconstructor yet. This
         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
         is needed for the cases where the resultdef is forced for a second
         run }
         run }
-        if (not allow_array_constructor) then
+        if not(allow_array_constructor) then
          begin
          begin
            hp:=tarrayconstructornode(getcopy);
            hp:=tarrayconstructornode(getcopy);
            arrayconstructor_to_set(tnode(hp));
            arrayconstructor_to_set(tnode(hp));

+ 2 - 1
compiler/parser.pas

@@ -49,7 +49,7 @@ implementation
       script,gendef,
       script,gendef,
       comphook,
       comphook,
       scanner,scandir,
       scanner,scandir,
-      pbase,ptype,psystem,pmodules,psub,ncgrtti,
+      pbase,ptype,psystem,pmodules,psub,ncgrtti,htypechk,
       cresstr,cpuinfo,procinfo;
       cresstr,cpuinfo,procinfo;
 
 
 
 
@@ -337,6 +337,7 @@ implementation
          named_args_allowed:=false;
          named_args_allowed:=false;
          got_addrn:=false;
          got_addrn:=false;
          getprocvardef:=nil;
          getprocvardef:=nil;
+         allow_array_constructor:=false;
 
 
        { show info }
        { show info }
          Message1(parser_i_compiling,filename);
          Message1(parser_i_compiling,filename);