Ver Fonte

* bug with p(const a : ansistring) fixed
* duplicate constant ansistrings were handled wrong, fixed

florian há 27 anos atrás
pai
commit
467c0de643
2 ficheiros alterados com 21 adições e 5 exclusões
  1. 8 4
      compiler/cg386cal.pas
  2. 13 1
      compiler/cg386con.pas

+ 8 - 4
compiler/cg386cal.pas

@@ -59,11 +59,11 @@ implementation
         begin
           push_addr:=(
 {$ifndef VALUEPARA}
-                      dont_copy_const_param(p^.resulttype) or
+                      dont_copy_const_param(p^.resulttype) { or }
 {$else}
-                      push_addr_param(p^.resulttype) or
+                      push_addr_param(p^.resulttype)
 {$endif}
-                      ((p^.treetype=stringconstn) and is_ansistring(p^.resulttype))
+{  hmmm, why this ?? (FK)  or ((p^.treetype=stringconstn) and is_ansistring(p^.resulttype)) }
                      );
         end;
 
@@ -1626,7 +1626,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.51  1998-12-10 09:47:15  florian
+  Revision 1.52  1998-12-10 14:39:29  florian
+    * bug with p(const a : ansistring) fixed
+    * duplicate constant ansistrings were handled wrong, fixed
+
+  Revision 1.51  1998/12/10 09:47:15  florian
     + basic operations with int64/qord (compiler with -dint64)
     + rtti of enumerations extended: names are now written
 

+ 13 - 1
compiler/cg386con.pas

@@ -179,6 +179,14 @@ implementation
                                begin
                                   { found! }
                                   p^.lab_str:=lastlabel;
+                                  if (p^.stringtype in [st_ansistring,st_widestring]) then
+                                    begin
+                                       getdatalabel(l2);
+                                       consts^.concat(new(pai_label,init(l2)));
+                                       consts^.concat(new(pai_const,init_symbol(strpnew(lab2str(p^.lab_str)))));
+                                       { return the offset of the real string }
+                                       p^.lab_str:=l2;
+                                    end;
                                   break;
                                end;
                           end;
@@ -364,7 +372,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.24  1998-11-28 15:36:02  michael
+  Revision 1.25  1998-12-10 14:39:30  florian
+    * bug with p(const a : ansistring) fixed
+    * duplicate constant ansistrings were handled wrong, fixed
+
+  Revision 1.24  1998/11/28 15:36:02  michael
   Fixed generation of constant ansistrings
 
   Revision 1.23  1998/11/26 14:39:12  peter