mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 00:09:32 +02:00
+ correctly set var state of addr and frame in raise statements, resolves #33818
git-svn-id: trunk@39162 -
This commit is contained in:
parent
4b45825204
commit
3b3e33d863
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -16148,6 +16148,7 @@ tests/webtbs/tw3360.pp svneol=native#text/plain
|
||||
tests/webtbs/tw33635.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3364.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3366.pp svneol=native#text/plain
|
||||
tests/webtbs/tw33818.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3402.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3411.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3418.pp svneol=native#text/plain
|
||||
|
@ -2169,11 +2169,14 @@ implementation
|
||||
begin
|
||||
{ addr }
|
||||
typecheckpass(right);
|
||||
set_varstate(right,vs_read,[vsf_must_be_valid]);
|
||||
inserttypeconv(right,voidcodepointertype);
|
||||
|
||||
{ frame }
|
||||
if assigned(third) then
|
||||
begin
|
||||
typecheckpass(third);
|
||||
set_varstate(third,vs_read,[vsf_must_be_valid]);
|
||||
inserttypeconv(third,voidpointertype);
|
||||
end;
|
||||
end;
|
||||
|
23
tests/webtbs/tw33818.pp
Normal file
23
tests/webtbs/tw33818.pp
Normal file
@ -0,0 +1,23 @@
|
||||
{ %OPT=-Seh -vh }
|
||||
{ %norun }
|
||||
{$mode objfpc}
|
||||
|
||||
program Project1;
|
||||
|
||||
uses
|
||||
SysUtils;
|
||||
|
||||
procedure RaiseException(AReturnAddress : Pointer);
|
||||
begin
|
||||
raise Exception.Create('message') at AReturnAddress;
|
||||
end;
|
||||
|
||||
procedure RaiseException(AReturnAddress : Pointer;AFrame : Pointer);
|
||||
begin
|
||||
raise Exception.Create('message') at AReturnAddress,AFrame;
|
||||
end;
|
||||
|
||||
begin
|
||||
RaiseException(Pointer(10));
|
||||
RaiseException(Pointer(10),Pointer(1234));
|
||||
end.
|
Loading…
Reference in New Issue
Block a user