mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 15:00:27 +02:00
* 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:
parent
208e7fb337
commit
f542ee7b92
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -16542,6 +16542,7 @@ tests/webtbf/tw37303.pp -text svneol=native#text/pascal
|
|||||||
tests/webtbf/tw3738.pp svneol=native#text/plain
|
tests/webtbf/tw3738.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw3740.pp svneol=native#text/plain
|
tests/webtbf/tw3740.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw37460.pp svneol=native#text/pascal
|
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/tw3790.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw3812.pp svneol=native#text/plain
|
tests/webtbf/tw3812.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw3930a.pp svneol=native#text/plain
|
tests/webtbf/tw3930a.pp svneol=native#text/plain
|
||||||
|
@ -273,8 +273,12 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ in case we are in a generic definition, we cannot
|
{ in case we are in a generic definition, we cannot
|
||||||
do all checks, the parameters might be type parameters }
|
do all checks, the parameters might be type parameters,
|
||||||
if df_generic in current_procinfo.procdef.defoptions then
|
|
||||||
|
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
|
begin
|
||||||
result.Free;
|
result.Free;
|
||||||
result:=nil;
|
result:=nil;
|
||||||
@ -1477,7 +1481,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
ordtype := torddef(def).ordtype;
|
ordtype := torddef(def).ordtype;
|
||||||
if not (ordtype in [s64bit,u64bit,s32bit,u32bit,s16bit,u16bit,s8bit,u8bit]) then
|
if not (ordtype in [s64bit,u64bit,s32bit,u32bit,s16bit,u16bit,s8bit,u8bit]) then
|
||||||
internalerror(2013032603);
|
internalerror(2020080101);
|
||||||
|
|
||||||
if is_oversizedint(def) then
|
if is_oversizedint(def) then
|
||||||
begin
|
begin
|
||||||
|
3
tests/webtbf/tw37462.pp
Normal file
3
tests/webtbf/tw37462.pp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{ %fail }
|
||||||
|
var a : string;
|
||||||
|
begin str(1 > 1 > 1, a)
|
Loading…
Reference in New Issue
Block a user