* don't crash in {$x-} mode if a call cannot be resolved due to an error

in the expression (mantis #17455)

git-svn-id: trunk@16061 -
This commit is contained in:
Jonas Maebe 2010-09-29 12:11:22 +00:00
parent 03b06dc7a1
commit bd0567563c
3 changed files with 15 additions and 0 deletions

1
.gitattributes vendored
View File

@ -9940,6 +9940,7 @@ tests/webtbf/tw1633.pp svneol=native#text/plain
tests/webtbf/tw1642.pp svneol=native#text/plain
tests/webtbf/tw1655.pp svneol=native#text/plain
tests/webtbf/tw1681.pp svneol=native#text/plain
tests/webtbf/tw17455.pp svneol=native#text/plain
tests/webtbf/tw1754.pp svneol=native#text/plain
tests/webtbf/tw1754b.pp svneol=native#text/plain
tests/webtbf/tw1782.pp svneol=native#text/plain

View File

@ -1207,6 +1207,8 @@ implementation
{ in $x- state, the function result must not be ignored }
if not(cs_extsyntax in current_settings.moduleswitches) and
not(is_void(p.resultdef)) and
{ can be nil in case there was an error in the expression }
assigned(tcallnode(p).procdefinition) and
not((tcallnode(p).procdefinition.proctypeoption=potype_constructor) and
assigned(tprocdef(tcallnode(p).procdefinition)._class) and
is_object(tprocdef(tcallnode(p).procdefinition)._class)) then

12
tests/webtbf/tw17455.pp Normal file
View File

@ -0,0 +1,12 @@
{ %fail }
{$mode macpas}
{$extendedsyntax off}
program crash;
var
thePStr: string[ 255];
begin
System.Move
( thePStr, MenuPtr^, Length( thePStr) + 1)
end.