* optimized previous patch for "byte in set" (Thorsten Engler)

* fixed storing/loading of setdefs to/from ppu + test (Thorsten Engler)
  * fixed ppudump for new setdef format in ppus

git-svn-id: trunk@6363 -
This commit is contained in:
Jonas Maebe 2007-02-07 20:22:29 +00:00
parent 794167b09d
commit f38d29cfab
6 changed files with 37 additions and 21 deletions

1
.gitattributes vendored
View File

@ -8033,6 +8033,7 @@ tests/webtbs/tw8222b.pp svneol=native#text/plain
tests/webtbs/tw8229.pp svneol=native#text/plain
tests/webtbs/tw8232.pp svneol=native#text/plain
tests/webtbs/tw8258.pp svneol=native#text/plain
tests/webtbs/tw8258a.pp svneol=native#text/plain
tests/webtbs/tw8264.pp svneol=native#text/plain
tests/webtbs/ub1873.pp svneol=native#text/plain
tests/webtbs/ub1883.pp svneol=native#text/plain

View File

@ -467,8 +467,8 @@ implementation
location.register := cg.getintregister(current_asmdata.CurrAsmList, uopsize);
if (opsize >= OS_S8) or { = if signed }
((left.resultdef.typ=orddef) and (torddef(left.resultdef).high >= tsetdef(right.resultdef).setmax)) or
((left.resultdef.typ=enumdef) and (tenumdef(left.resultdef).max >= tsetdef(right.resultdef).setmax)) then
((left.resultdef.typ=orddef) and (torddef(left.resultdef).high > tsetdef(right.resultdef).setmax)) or
((left.resultdef.typ=enumdef) and (tenumdef(left.resultdef).max > tsetdef(right.resultdef).setmax)) then
begin
current_asmdata.getjumplabel(l);
current_asmdata.getjumplabel(l2);

View File

@ -2036,13 +2036,9 @@ implementation
inherited ppuload(setdef,ppufile);
ppufile.getderef(elementdefderef);
settype:=tsettype(ppufile.getbyte);
case settype of
normset :
savesize:=ppufile.getaint;
varset,
smallset :
savesize:=ppufile.getlongint;
end;
savesize:=ppufile.getaint;
setbase:=ppufile.getaint;
setmax:=ppufile.getaint;
end;
@ -2060,13 +2056,9 @@ implementation
inherited ppuwrite(ppufile);
ppufile.putderef(elementdefderef);
ppufile.putbyte(byte(settype));
case settype of
varset,
smallset:
ppufile.putlongint(savesize);
normset:
ppufile.putaint(savesize);
end;
ppufile.putaint(savesize);
ppufile.putaint(setbase);
ppufile.putaint(setmax);
ppufile.writeentry(ibsetdef);
end;

View File

@ -1940,12 +1940,19 @@ begin
write (space,' Element type : ');
readderef;
b:=getbyte;
// skip savesize
getaint;
case tsettype(b) of
smallset : writeln(space,' Set with 32 Elements');
normset : writeln(space,' Set with 256 Elements');
varset : writeln(space,' Set with ',getlongint,' Elements');
smallset : write(space,' SmallSet');
normset : write(space,' NormalSet');
varset : write(space,' VarSet');
else writeln('!! Warning: Invalid set type ',b);
end;
// set base
l:=getaint;
// set max
j:=getaint;
writeln(' with ',j-l,' elements');
end;
ibvariantdef :

View File

@ -428,8 +428,8 @@ implementation
location_freetemp(current_asmdata.CurrAsmList,left.location);
if (opsize >= OS_S8) or { = if signed }
((left.resultdef.typ=orddef) and (torddef(left.resultdef).high >= tsetdef(right.resultdef).setmax)) or
((left.resultdef.typ=enumdef) and (tenumdef(left.resultdef).max >= tsetdef(right.resultdef).setmax)) then
((left.resultdef.typ=orddef) and (torddef(left.resultdef).high > tsetdef(right.resultdef).setmax)) or
((left.resultdef.typ=enumdef) and (tenumdef(left.resultdef).max > tsetdef(right.resultdef).setmax)) then
begin
{ we have to check if the value is < 0 or > setmax }

16
tests/webtbs/tw8258a.pp Normal file
View File

@ -0,0 +1,16 @@
program SetsFUBAR;
uses
SysUtils;
var
FCommentChars: TSysCharSet;
s: string;
begin
s := '#';
FCommentChars := [';','#'];
if not (s[1] in FCommentChars) then
halt(1);
end.