Răsfoiți Sursa

* fixed loading widestring constsym values from ppu files (mantis #13583)
* null-terminate loaded ansistring/resourcestring constants from ppu files

git-svn-id: trunk@13033 -

Jonas Maebe 16 ani în urmă
părinte
comite
37a2cff8fb
4 a modificat fișierele cu 26 adăugiri și 1 ștergeri
  1. 2 0
      .gitattributes
  2. 2 1
      compiler/symsym.pas
  3. 8 0
      tests/webtbs/tw13583.pp
  4. 14 0
      tests/webtbs/uw13583.pp

+ 2 - 0
.gitattributes

@@ -8826,6 +8826,7 @@ tests/webtbs/tw13536.pp svneol=native#text/plain
 tests/webtbs/tw13552.pp svneol=native#text/plain
 tests/webtbs/tw13553.pp svneol=native#text/plain
 tests/webtbs/tw13563.pp svneol=native#text/plain
+tests/webtbs/tw13583.pp svneol=native#text/plain
 tests/webtbs/tw1364.pp svneol=native#text/plain
 tests/webtbs/tw1365.pp svneol=native#text/plain
 tests/webtbs/tw1374.pp svneol=native#text/plain
@@ -9715,6 +9716,7 @@ tests/webtbs/uw1279.pp svneol=native#text/plain
 tests/webtbs/uw13015.pp svneol=native#text/plain
 tests/webtbs/uw1331.pp svneol=native#text/plain
 tests/webtbs/uw13345y.pp svneol=native#text/plain
+tests/webtbs/uw13583.pp svneol=native#text/plain
 tests/webtbs/uw2004.inc svneol=native#text/plain
 tests/webtbs/uw2040.pp svneol=native#text/plain
 tests/webtbs/uw2266a.inc svneol=native#text/plain

+ 2 - 1
compiler/symsym.pas

@@ -1521,7 +1521,7 @@ implementation
              begin
                initwidestring(pw);
                setlengthwidestring(pw,ppufile.getlongint);
-               ppufile.getdata(pw^.data,pw^.len*sizeof(tcompilerwidechar));
+               ppufile.getdata(pw^.data^,pw^.len*sizeof(tcompilerwidechar));
                pcompilerwidestring(value.valueptr):=pw;
              end;
            conststring,
@@ -1530,6 +1530,7 @@ implementation
                value.len:=ppufile.getlongint;
                getmem(pc,value.len+1);
                ppufile.getdata(pc^,value.len);
+               pc[value.len]:=#0;
                value.valueptr:=pc;
              end;
            constreal :

+ 8 - 0
tests/webtbs/tw13583.pp

@@ -0,0 +1,8 @@
+{ %recompile }
+
+uses
+  uw13583;
+
+begin
+  writeln(DEFAULT_SIGNATURE);
+end.

+ 14 - 0
tests/webtbs/uw13583.pp

@@ -0,0 +1,14 @@
+unit uw13583;
+
+interface
+
+type
+//  TEDBString = WideString;
+  TEDBString = ansiString;
+
+const
+  DEFAULT_SIGNATURE = TEDBString('edb_signature');
+
+implementation
+
+end.