diff --git a/.gitattributes b/.gitattributes index 546e9019c5..ac8bc77d6e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/compiler/pstatmnt.pas b/compiler/pstatmnt.pas index 06a72e2818..4d8f53c8c2 100644 --- a/compiler/pstatmnt.pas +++ b/compiler/pstatmnt.pas @@ -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 diff --git a/tests/webtbf/tw17455.pp b/tests/webtbf/tw17455.pp new file mode 100644 index 0000000000..3f636deffa --- /dev/null +++ b/tests/webtbf/tw17455.pp @@ -0,0 +1,12 @@ +{ %fail } + +{$mode macpas} +{$extendedsyntax off} + +program crash; +var + thePStr: string[ 255]; +begin + System.Move + ( thePStr, MenuPtr^, Length( thePStr) + 1) +end.