mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 23:39:31 +02:00
parent
441d5a3c12
commit
35c58e24b4
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -7247,6 +7247,7 @@ tests/webtbs/tw5086.pp -text
|
||||
tests/webtbs/tw5094.pp -text
|
||||
tests/webtbs/tw5100.pp svneol=native#text/plain
|
||||
tests/webtbs/tw5100a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw5641.pp svneol=native#text/plain
|
||||
tests/webtbs/tw6203.pp svneol=native#text/plain
|
||||
tests/webtbs/tw6435.pp svneol=native#text/plain
|
||||
tests/webtbs/tw6491.pp svneol=native#text/plain
|
||||
|
23
tests/webtbs/tw5641.pp
Normal file
23
tests/webtbs/tw5641.pp
Normal file
@ -0,0 +1,23 @@
|
||||
// Title: bad construction status of object.
|
||||
{$C+}
|
||||
uses Objects;
|
||||
|
||||
var
|
||||
mempool: Pointer;
|
||||
obj: PObject;
|
||||
begin
|
||||
GetMem(mempool, $2000000);
|
||||
Assert(mempool<>nil, 'GetMem failed');
|
||||
obj:=Pointer((Cardinal(mempool) or $FF));
|
||||
Assert(obj^.init, 'case 1a ((addr and $FF) <> 0)');
|
||||
Assert(obj^.init, 'case 1b ((addr and $FF) <> 0)');
|
||||
Assert(obj^.init, 'case 1c ((addr and $FF) <> 0)');
|
||||
obj:=Pointer((Cardinal(mempool) or $FF) + 1);
|
||||
Assert(obj^.init, 'case 2 (addr=$xxxxxx00)');
|
||||
obj:=Pointer((Cardinal(mempool) or $FFFF) + 1);
|
||||
Assert(obj^.init, 'case 3 (addr=$xxxx0000)');
|
||||
obj:=Pointer((Cardinal(mempool) or $FFFFFF) + 1);
|
||||
Assert(obj^.init, 'case 4 (addr=$xx000000)');
|
||||
FreeMem(mempool);
|
||||
writeln('ok');
|
||||
end.
|
Loading…
Reference in New Issue
Block a user