mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 08:11:36 +02:00
+ new test which should fail but doesn't yet (it should not be possible to
use a char typecasted as a chararray with more than one element as an lvalue) git-svn-id: trunk@12708 -
This commit is contained in:
parent
31f3d1ead1
commit
b3aa2ab759
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -6662,6 +6662,7 @@ tests/tbf/tb0211.pp svneol=native#text/plain
|
|||||||
tests/tbf/tb0212.pp svneol=native#text/plain
|
tests/tbf/tb0212.pp svneol=native#text/plain
|
||||||
tests/tbf/tb0213.pp svneol=native#text/plain
|
tests/tbf/tb0213.pp svneol=native#text/plain
|
||||||
tests/tbf/tb0214.pp svneol=native#text/plain
|
tests/tbf/tb0214.pp svneol=native#text/plain
|
||||||
|
tests/tbf/tb0215.pp svneol=native#text/plain
|
||||||
tests/tbf/ub0115.pp svneol=native#text/plain
|
tests/tbf/ub0115.pp svneol=native#text/plain
|
||||||
tests/tbf/ub0149.pp svneol=native#text/plain
|
tests/tbf/ub0149.pp svneol=native#text/plain
|
||||||
tests/tbf/ub0158a.pp svneol=native#text/plain
|
tests/tbf/ub0158a.pp svneol=native#text/plain
|
||||||
|
20
tests/tbf/tb0215.pp
Normal file
20
tests/tbf/tb0215.pp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{ %fail }
|
||||||
|
|
||||||
|
{$r-}
|
||||||
|
type
|
||||||
|
chararray = array[0..200] of char;
|
||||||
|
var
|
||||||
|
p: pchar;
|
||||||
|
i: longint;
|
||||||
|
begin
|
||||||
|
getmem(p,5);
|
||||||
|
p[0]:='a';
|
||||||
|
p[1]:='b';
|
||||||
|
p[2]:='c';
|
||||||
|
p[3]:='d';
|
||||||
|
p[4]:=#0;
|
||||||
|
i:=3;
|
||||||
|
chararray(p^)[i]:=#0;
|
||||||
|
writeln(p);
|
||||||
|
freemem(p);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user