+ 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:
Jonas Maebe 2009-02-07 22:20:47 +00:00
parent 31f3d1ead1
commit b3aa2ab759
2 changed files with 21 additions and 0 deletions

1
.gitattributes vendored
View File

@ -6662,6 +6662,7 @@ tests/tbf/tb0211.pp svneol=native#text/plain
tests/tbf/tb0212.pp svneol=native#text/plain
tests/tbf/tb0213.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/ub0149.pp svneol=native#text/plain
tests/tbf/ub0158a.pp svneol=native#text/plain

20
tests/tbf/tb0215.pp Normal file
View 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.