+ Discovered a bug regarding string bounds checking, add tests for it.

git-svn-id: trunk@7823 -
This commit is contained in:
daniel 2007-06-26 17:23:49 +00:00
parent 7bdc2ccbfb
commit eef2d4a1df
3 changed files with 36 additions and 0 deletions

2
.gitattributes vendored
View File

@ -5798,6 +5798,8 @@ tests/tbf/tb0197.pp svneol=native#text/plain
tests/tbf/tb0198.pp svneol=native#text/plain
tests/tbf/tb0199.pp -text
tests/tbf/tb0199a.pp -text
tests/tbf/tb0200.pp svneol=native#text/x-pascal
tests/tbf/tb0201.pp svneol=native#text/x-pascal
tests/tbf/ub0115.pp svneol=native#text/plain
tests/tbf/ub0149.pp svneol=native#text/plain
tests/tbf/ub0158a.pp svneol=native#text/plain

17
tests/tbf/tb0200.pp Normal file
View File

@ -0,0 +1,17 @@
program tb0200;
{$H-}
{TP rejects this code both with range checking off and on. However,
we allow indexing arrays out of bounds with range checks off, so
we best reject this then only with range checking on.}
{$Q+,R+}
var a:string;
c:char;
begin
a:='';
c:=a[257];
end.

17
tests/tbf/tb0201.pp Normal file
View File

@ -0,0 +1,17 @@
program tb0200;
{$H-}
{$Q+,R+}
var a:string;
b:string[63];
c:char;
w:word;
begin
a:='';
b:='';
w:=257;
c:=a[w];
c:=b[w];
end.