mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 14:27:59 +02:00
+ give an error if allocated temps. overflow the normally max. available space
git-svn-id: trunk@30449 -
This commit is contained in:
parent
444b63cf07
commit
b684719f1e
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -9839,6 +9839,7 @@ tests/tbf/tb0247.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0248.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0249.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0250.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0251.pp svneol=native#text/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
|
||||
|
@ -413,12 +413,16 @@ implementation
|
||||
{ Extend the temp }
|
||||
if direction=-1 then
|
||||
begin
|
||||
if qword(align(-lasttemp-alignmismatch,alignment))+size+alignmismatch>high(tl^.pos) then
|
||||
CGMessage(cg_e_localsize_too_big);
|
||||
lasttemp:=(-align(-lasttemp-alignmismatch,alignment))-size-alignmismatch;
|
||||
tl^.pos:=lasttemp;
|
||||
end
|
||||
else
|
||||
begin
|
||||
tl^.pos:=align(lasttemp+alignmismatch,alignment)-alignmismatch;
|
||||
if qword(tl^.pos)+size>high(tl^.pos) then
|
||||
CGMessage(cg_e_localsize_too_big);
|
||||
lasttemp:=tl^.pos+size;
|
||||
end;
|
||||
|
||||
|
11
tests/tbf/tb0251.pp
Normal file
11
tests/tbf/tb0251.pp
Normal file
@ -0,0 +1,11 @@
|
||||
{ %fail }
|
||||
procedure p;
|
||||
var
|
||||
{ generate big local data structures which overflow the stack for sure }
|
||||
a1,a2,a3,a4,a5 : array[0..high(sizeint) div 4] of byte;
|
||||
begin
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user