Browse Source

* fix for bug0216

pierre 26 years ago
parent
commit
c881aae7e9
2 changed files with 24 additions and 4 deletions
  1. 18 1
      compiler/pstatmnt.pas
  2. 6 3
      compiler/tcld.pas

+ 18 - 1
compiler/pstatmnt.pas

@@ -387,6 +387,13 @@ unit pstatmnt;
                               symtab^.next:=new(pwithsymtable,init);
                               symtab^.next:=new(pwithsymtable,init);
                               symtab:=symtab^.next;
                               symtab:=symtab^.next;
                               symtab^.root:=obj^.publicsyms^.root;
                               symtab^.root:=obj^.publicsyms^.root;
+{$ifndef NODIRECTWITH}
+                              if (p^.treetype=loadn) and
+                                 (p^.symtable=aktprocsym^.definition^.localst) then
+                                pwithsymtable(symtab)^.direct_with:=true;
+                              {symtab^.withnode:=p; not yet allocated !! }
+                              pwithsymtable(symtab)^.withrefnode:=p;
+{$endif ndef NODIRECTWITH}
                               symtab^.defowner:=obj;
                               symtab^.defowner:=obj;
                               obj:=obj^.childof;
                               obj:=obj^.childof;
                               inc(levelcount);
                               inc(levelcount);
@@ -400,6 +407,13 @@ unit pstatmnt;
                            withsymtable:=new(pwithsymtable,init);
                            withsymtable:=new(pwithsymtable,init);
                            withsymtable^.root:=symtab^.root;
                            withsymtable^.root:=symtab^.root;
                            withsymtable^.next:=symtablestack;
                            withsymtable^.next:=symtablestack;
+{$ifndef NODIRECTWITH}
+                              if (p^.treetype=loadn) and
+                                 (p^.symtable=aktprocsym^.definition^.localst) then
+                                pwithsymtable(withsymtable)^.direct_with:=true;
+                              {symtab^.withnode:=p; not yet allocated !! }
+                              pwithsymtable(withsymtable)^.withrefnode:=p;
+{$endif ndef NODIRECTWITH}
                            withsymtable^.defowner:=obj;
                            withsymtable^.defowner:=obj;
                            symtablestack:=withsymtable;
                            symtablestack:=withsymtable;
                         end;
                         end;
@@ -1263,7 +1277,10 @@ unit pstatmnt;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.64  1999-02-11 09:46:26  pierre
+  Revision 1.65  1999-02-15 13:13:15  pierre
+   * fix for bug0216
+
+  Revision 1.64  1999/02/11 09:46:26  pierre
     * fix for normal method calls inside static methods :
     * fix for normal method calls inside static methods :
       WARNING there were both parser and codegen errors !!
       WARNING there were both parser and codegen errors !!
       added static_call boolean to calln tree
       added static_call boolean to calln tree

+ 6 - 3
compiler/tcld.pas

@@ -62,11 +62,11 @@ implementation
          if (p^.symtable^.symtabletype=withsymtable) and
          if (p^.symtable^.symtabletype=withsymtable) and
             (pwithsymtable(p^.symtable)^.direct_with) then
             (pwithsymtable(p^.symtable)^.direct_with) then
            begin
            begin
-              p1:=getcopy(ptree(pwithsymtable(p^.symtable)^.withnode)^.left);
+              p1:=getcopy(ptree(pwithsymtable(p^.symtable)^.withrefnode));
               p1:=gensubscriptnode(pvarsym(p^.symtableentry),p1);
               p1:=gensubscriptnode(pvarsym(p^.symtableentry),p1);
               putnode(p);
               putnode(p);
               p:=p1;
               p:=p1;
-              firstpass(p1);
+              firstpass(p);
               exit;
               exit;
            end;
            end;
 {$endif ndef NODIRECTWITH}
 {$endif ndef NODIRECTWITH}
@@ -447,7 +447,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.14  1999-01-27 00:13:58  florian
+  Revision 1.15  1999-02-15 13:13:19  pierre
+   * fix for bug0216
+
+  Revision 1.14  1999/01/27 00:13:58  florian
     * "procedure of object"-stuff fixed
     * "procedure of object"-stuff fixed
 
 
   Revision 1.13  1999/01/21 16:41:07  pierre
   Revision 1.13  1999/01/21 16:41:07  pierre