mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-23 10:49:26 +01:00
+ Discovered a bug regarding string bounds checking, add tests for it.
git-svn-id: trunk@7823 -
This commit is contained in:
parent
7bdc2ccbfb
commit
eef2d4a1df
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -5798,6 +5798,8 @@ tests/tbf/tb0197.pp svneol=native#text/plain
|
|||||||
tests/tbf/tb0198.pp svneol=native#text/plain
|
tests/tbf/tb0198.pp svneol=native#text/plain
|
||||||
tests/tbf/tb0199.pp -text
|
tests/tbf/tb0199.pp -text
|
||||||
tests/tbf/tb0199a.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/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
|
||||||
|
|||||||
17
tests/tbf/tb0200.pp
Normal file
17
tests/tbf/tb0200.pp
Normal 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
17
tests/tbf/tb0201.pp
Normal 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.
|
||||||
Loading…
Reference in New Issue
Block a user