* correctly set expectloc for bool->cbool type conversions (mantis #22502)

git-svn-id: trunk@21973 -
This commit is contained in:
Jonas Maebe 2012-07-26 14:50:28 +00:00
parent df2eddd169
commit 44fd18a041
3 changed files with 12 additions and 1 deletions

1
.gitattributes vendored
View File

@ -12682,6 +12682,7 @@ tests/webtbs/tw22331.pp svneol=native#text/plain
tests/webtbs/tw22344.pp svneol=native#text/plain
tests/webtbs/tw2242.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/tw2260.pp svneol=native#text/plain
tests/webtbs/tw2266.pp svneol=native#text/plain

View File

@ -3078,7 +3078,8 @@ implementation
function ttypeconvnode.first_bool_to_bool : tnode;
begin
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
else
expectloc:=LOC_REGISTER;

9
tests/webtbs/tw22502.pp Normal file
View File

@ -0,0 +1,9 @@
var
b: Boolean;
begin
b:=true;
b := longbool(b = b);
if not b then
halt(1);
end.