mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 10:40:13 +02:00
* don't generate pointer checks for newly initialized by new pointers, resolves #8757
git-svn-id: trunk@7168 -
This commit is contained in:
parent
d83a869018
commit
f4868c2414
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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
15
tests/webtbs/tw8757.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user