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

git-svn-id: trunk@7168 -
This commit is contained in:
florian 2007-04-24 20:19:25 +00:00
parent d83a869018
commit f4868c2414
3 changed files with 20 additions and 1 deletions

1
.gitattributes vendored
View File

@ -8166,6 +8166,7 @@ tests/webtbs/tw8615.pp svneol=native#text/plain
tests/webtbs/tw8633.pp svneol=native#text/plain
tests/webtbs/tw8660.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

View File

@ -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
tests/webtbs/tw8757.pp Normal file
View File

@ -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.