Browse Source

* fixed compilerwidestring concatenation

git-svn-id: trunk@1876 -
florian 19 năm trước cách đây
mục cha
commit
0907a1ef80
3 tập tin đã thay đổi với 5 bổ sung4 xóa
  1. 2 2
      compiler/ncon.pas
  2. 1 1
      compiler/pass_1.pas
  3. 2 1
      compiler/widestr.pas

+ 2 - 2
compiler/ncon.pas

@@ -558,9 +558,9 @@ implementation
     destructor tstringconstnode.destroy;
       begin
         if st_type=st_widestring then
-         donewidestring(pcompilerwidestring(value_str))
+          donewidestring(pcompilerwidestring(value_str))
         else
-         ansistringdispose(value_str,len);
+          ansistringdispose(value_str,len);
         inherited destroy;
       end;
 

+ 1 - 1
compiler/pass_1.pas

@@ -97,7 +97,7 @@ implementation
          begin
            { update the codegenerror boolean with the previous result of this node }
            if (nf_error in p.flags) then
-            codegenerror:=true;
+             codegenerror:=true;
          end;
       end;
 

+ 2 - 1
compiler/widestr.pas

@@ -104,6 +104,7 @@ unit widestr;
            reallocmem(r^.data,sizeof(tcompilerwidechar)*l)
          else
            getmem(r^.data,sizeof(tcompilerwidechar)*l);
+         r^.maxlen:=l;
       end;
 
     procedure concatwidestringchar(r : pcompilerwidestring;c : tcompilerwidechar);
@@ -118,8 +119,8 @@ unit widestr;
     procedure concatwidestrings(s1,s2 : pcompilerwidestring);
       begin
          setlengthwidestring(s1,s1^.len+s2^.len);
-         inc(s1^.len,s2^.len);
          move(s2^.data^,s1^.data[s1^.len],s2^.len*sizeof(tcompilerwidechar));
+         inc(s1^.len,s2^.len);
       end;
 
     procedure copywidestring(s,d : pcompilerwidestring);