* fixed wrong internal error in case a swapped set <op> setelement

addnode was processed after r10432/10433 (mantis #11255)

git-svn-id: trunk@10904 -
This commit is contained in:
Jonas Maebe 2008-05-07 18:11:18 +00:00
parent 1ec04dfd36
commit 0645313da5
3 changed files with 33 additions and 4 deletions

1
.gitattributes vendored
View File

@ -8185,6 +8185,7 @@ tests/webtbs/tw1122.pp svneol=native#text/plain
tests/webtbs/tw1123.pp svneol=native#text/plain
tests/webtbs/tw1124.pp svneol=native#text/plain
tests/webtbs/tw11254.pp svneol=native#text/plain
tests/webtbs/tw11255.pp svneol=native#text/plain
tests/webtbs/tw1132.pp svneol=native#text/plain
tests/webtbs/tw1133.pp svneol=native#text/plain
tests/webtbs/tw1152.pp svneol=native#text/plain

View File

@ -383,10 +383,15 @@ implementation
pass_left_and_right;
{ when a setdef is passed, it has to be a smallset }
if not is_smallset(left.resultdef) or
(not is_smallset(right.resultdef) and
(right.nodetype<>setelementn)) then
internalerror(200203301);
if (not(nf_swapped in flags) and
not is_smallset(left.resultdef) or
(not is_smallset(right.resultdef) and
(right.nodetype<>setelementn))) or
((nf_swapped in flags) and
not is_smallset(right.resultdef) or
(not is_smallset(left.resultdef) and
(left.nodetype<>setelementn))) then
internalerror(200203359);
opdone := false;
cmpop:=nodetype in [equaln,unequaln,lten,gten];

23
tests/webtbs/tw11255.pp Normal file
View File

@ -0,0 +1,23 @@
program bug11255;
{$mode objfpc}{$h+}
type
TLCLPlatform = (
lpCarbon
);
TLCLPlatforms = set of TLCLPlatform;
var
WidgetSets: TLCLPlatforms;
function DirNameToLCLPlatform: TLCLPlatform;
begin
Result:=lpCarbon;
end;
begin
WidgetSets := [DirNameToLCLPlatform];
if widgetsets<>[lpcarbon] then
halt(1);
end.