* do not throw an internal error if an errorneous type is passed to str, resolves #37462

git-svn-id: trunk@45983 -
This commit is contained in:
florian 2020-08-01 21:11:35 +00:00
parent 208e7fb337
commit f542ee7b92
3 changed files with 11 additions and 3 deletions

1
.gitattributes vendored
View File

@ -16542,6 +16542,7 @@ tests/webtbf/tw37303.pp -text svneol=native#text/pascal
tests/webtbf/tw3738.pp svneol=native#text/plain
tests/webtbf/tw3740.pp svneol=native#text/plain
tests/webtbf/tw37460.pp svneol=native#text/pascal
tests/webtbf/tw37462.pp svneol=native#text/pascal
tests/webtbf/tw3790.pp svneol=native#text/plain
tests/webtbf/tw3812.pp svneol=native#text/plain
tests/webtbf/tw3930a.pp svneol=native#text/plain

View File

@ -273,8 +273,12 @@ implementation
end;
{ in case we are in a generic definition, we cannot
do all checks, the parameters might be type parameters }
if df_generic in current_procinfo.procdef.defoptions then
do all checks, the parameters might be type parameters,
bailout as well in case of an error before }
if (df_generic in current_procinfo.procdef.defoptions) or
(dest.resultdef.typ=errordef) or
(source.resultdef.typ=errordef) then
begin
result.Free;
result:=nil;
@ -1477,7 +1481,7 @@ implementation
begin
ordtype := torddef(def).ordtype;
if not (ordtype in [s64bit,u64bit,s32bit,u32bit,s16bit,u16bit,s8bit,u8bit]) then
internalerror(2013032603);
internalerror(2020080101);
if is_oversizedint(def) then
begin

3
tests/webtbf/tw37462.pp Normal file
View File

@ -0,0 +1,3 @@
{ %fail }
var a : string;
begin str(1 > 1 > 1, a)