Răsfoiți Sursa

Merged revisions 7167-7168 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r7167 | florian | 2007-04-24 10:53:59 +0200 (Tue, 24 Apr 2007) | 2 lines

* don't write def for constant widestrings

........
r7168 | florian | 2007-04-24 22:19:25 +0200 (Tue, 24 Apr 2007) | 2 lines

* don't generate pointer checks for newly initialized by new pointers, resolves #8757

........

git-svn-id: branches/fixes_2_2@7192 -

joost 18 ani în urmă
părinte
comite
8561175b01
4 a modificat fișierele cu 22 adăugiri și 3 ștergeri
  1. 1 0
      .gitattributes
  2. 2 2
      compiler/dbgdwarf.pas
  3. 4 1
      compiler/pinline.pas
  4. 15 0
      tests/webtbs/tw8757.pp

+ 1 - 0
.gitattributes

@@ -8057,6 +8057,7 @@ tests/webtbs/tw8462.pp svneol=native#text/plain
 tests/webtbs/tw8513.pp svneol=native#text/plain
 tests/webtbs/tw8573.pp svneol=native#text/plain
 tests/webtbs/tw8664.pp svneol=native#text/plain
+tests/webtbs/tw8757.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain

+ 2 - 2
compiler/dbgdwarf.pas

@@ -1640,7 +1640,7 @@ implementation
 
 	    if (target_info.system = system_powerpc64_linux) then
 	      procentry := '.' + pd.mangledname
-	    else 
+	    else
 	      procentry := pd.mangledname;
 
             append_labelentry(DW_AT_low_pc,current_asmdata.RefAsmSymbol(procentry));
@@ -1852,7 +1852,7 @@ implementation
             DW_AT_name,DW_FORM_string,symname(sym)+#0
             ]);
           { for string constants, constdef isn't set because they have no real type }
-          if not(sym.consttyp in [conststring,constresourcestring]) then
+          if not(sym.consttyp in [conststring,constresourcestring,constwstring]) then
             append_labelentry_ref(DW_AT_type,def_dwarf_lab(sym.constdef));
           current_asmdata.asmlists[al_dwarf_abbrev].concat(tai_const.create_uleb128bit(ord(DW_AT_const_value)));
           case sym.consttyp of

+ 4 - 1
compiler/pinline.pas

@@ -206,7 +206,10 @@ implementation
                 { For new(var,constructor) we need to take a copy because
                   p is also used in the assignmentn below }
                 if is_new then
-                  p2:=cderefnode.create(p.getcopy)
+                  begin
+                    p2:=cderefnode.create(p.getcopy);
+                    include(p2.flags,nf_no_checkpointer);
+                  end
                 else
                   p2:=cderefnode.create(p);
                 do_typecheckpass(p2);

+ 15 - 0
tests/webtbs/tw8757.pp

@@ -0,0 +1,15 @@
+{ %OPT=-ghc }
+//test.pp
+type o=object
+      constructor init;
+     end;
+
+constructor o.init; begin end;
+
+var o1 : ^o;
+
+begin
+  New(o1,init);
+  // New(o1); o1^.init; <- no error
+  dispose(o1);
+end.