Jelajahi Sumber

* store/restore trttinode.rttidatatype to/from ppu file, and also copy it in
rttidatatype.getcopy (fixes mantis #15207)

git-svn-id: trunk@14318 -

Jonas Maebe 15 tahun lalu
induk
melakukan
280f27b45c
4 mengubah file dengan 32 tambahan dan 1 penghapusan
  1. 1 0
      .gitattributes
  2. 3 0
      compiler/nld.pas
  3. 1 1
      compiler/ppu.pas
  4. 27 0
      tests/webtbs/tw15207.pp

+ 1 - 0
.gitattributes

@@ -10102,6 +10102,7 @@ tests/webtbs/tw14958b.pp svneol=native#text/plain
 tests/webtbs/tw1501.pp svneol=native#text/plain
 tests/webtbs/tw15088.pp svneol=native#text/plain
 tests/webtbs/tw15169.pp svneol=native#text/plain
+tests/webtbs/tw15207.pp svneol=native#text/plain
 tests/webtbs/tw1532.pp svneol=native#text/plain
 tests/webtbs/tw1539.pp svneol=native#text/plain
 tests/webtbs/tw1567.pp svneol=native#text/plain

+ 3 - 0
compiler/nld.pas

@@ -1104,6 +1104,7 @@ implementation
         inherited ppuload(t,ppufile);
         ppufile.getderef(rttidefderef);
         rttitype:=trttitype(ppufile.getbyte);
+        rttidatatype:=trttidatatype(ppufile.getbyte);
       end;
 
 
@@ -1112,6 +1113,7 @@ implementation
         inherited ppuwrite(ppufile);
         ppufile.putderef(rttidefderef);
         ppufile.putbyte(byte(rttitype));
+        ppufile.putbyte(byte(rttidatatype));
       end;
 
 
@@ -1136,6 +1138,7 @@ implementation
          n:=trttinode(inherited dogetcopy);
          n.rttidef:=rttidef;
          n.rttitype:=rttitype;
+         n.rttidatatype:=rttidatatype;
          result:=n;
       end;
 

+ 1 - 1
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 
 const
-  CurrentPPUVersion = 105;
+  CurrentPPUVersion = 106;
 
 { buffer sizes }
   maxentrysize = 1024;

+ 27 - 0
tests/webtbs/tw15207.pp

@@ -0,0 +1,27 @@
+program testinline;
+
+{$mode objfpc}{$H+}
+
+type
+  enumtest = (e1, e2);
+
+function Test: Boolean; inline;
+var
+  e: enumtest;
+  s: String;
+begin
+  e := e1;
+  WriteStr(s, e);
+  result:=s='e1';
+end;
+
+procedure TestProc;
+begin
+  if not Test then
+    halt(1);
+end;
+
+begin
+  TestProc;
+end.
+