+ correctly set var state of addr and frame in raise statements, resolves #33818

git-svn-id: trunk@39162 -
This commit is contained in:
florian 2018-06-03 09:31:19 +00:00
parent 4b45825204
commit 3b3e33d863
3 changed files with 27 additions and 0 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -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
View 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.