mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 16:09:17 +02:00
* correctly set expectloc for bool->cbool type conversions (mantis #22502)
git-svn-id: trunk@21973 -
This commit is contained in:
parent
df2eddd169
commit
44fd18a041
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -12682,6 +12682,7 @@ tests/webtbs/tw22331.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw22344.pp svneol=native#text/plain
|
tests/webtbs/tw22344.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2242.pp svneol=native#text/plain
|
tests/webtbs/tw2242.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2250.pp svneol=native#text/plain
|
tests/webtbs/tw2250.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw22502.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2259.pp svneol=native#text/plain
|
tests/webtbs/tw2259.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2260.pp svneol=native#text/plain
|
tests/webtbs/tw2260.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2266.pp svneol=native#text/plain
|
tests/webtbs/tw2266.pp svneol=native#text/plain
|
||||||
|
@ -3078,7 +3078,8 @@ implementation
|
|||||||
function ttypeconvnode.first_bool_to_bool : tnode;
|
function ttypeconvnode.first_bool_to_bool : tnode;
|
||||||
begin
|
begin
|
||||||
first_bool_to_bool:=nil;
|
first_bool_to_bool:=nil;
|
||||||
if (left.expectloc in [LOC_FLAGS,LOC_JUMP]) then
|
if (left.expectloc in [LOC_FLAGS,LOC_JUMP]) and
|
||||||
|
not is_cbool(resultdef) then
|
||||||
expectloc := left.expectloc
|
expectloc := left.expectloc
|
||||||
else
|
else
|
||||||
expectloc:=LOC_REGISTER;
|
expectloc:=LOC_REGISTER;
|
||||||
|
9
tests/webtbs/tw22502.pp
Normal file
9
tests/webtbs/tw22502.pp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
var
|
||||||
|
b: Boolean;
|
||||||
|
begin
|
||||||
|
b:=true;
|
||||||
|
b := longbool(b = b);
|
||||||
|
if not b then
|
||||||
|
halt(1);
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user