mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 10:09:20 +02:00
* 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:
parent
794167b09d
commit
f38d29cfab
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8033,6 +8033,7 @@ tests/webtbs/tw8222b.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw8229.pp svneol=native#text/plain
|
tests/webtbs/tw8229.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw8232.pp svneol=native#text/plain
|
tests/webtbs/tw8232.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw8258.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/tw8264.pp svneol=native#text/plain
|
||||||
tests/webtbs/ub1873.pp svneol=native#text/plain
|
tests/webtbs/ub1873.pp svneol=native#text/plain
|
||||||
tests/webtbs/ub1883.pp svneol=native#text/plain
|
tests/webtbs/ub1883.pp svneol=native#text/plain
|
||||||
|
@ -467,8 +467,8 @@ implementation
|
|||||||
location.register := cg.getintregister(current_asmdata.CurrAsmList, uopsize);
|
location.register := cg.getintregister(current_asmdata.CurrAsmList, uopsize);
|
||||||
|
|
||||||
if (opsize >= OS_S8) or { = if signed }
|
if (opsize >= OS_S8) or { = if signed }
|
||||||
((left.resultdef.typ=orddef) and (torddef(left.resultdef).high >= tsetdef(right.resultdef).setmax)) or
|
((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=enumdef) and (tenumdef(left.resultdef).max > tsetdef(right.resultdef).setmax)) then
|
||||||
begin
|
begin
|
||||||
current_asmdata.getjumplabel(l);
|
current_asmdata.getjumplabel(l);
|
||||||
current_asmdata.getjumplabel(l2);
|
current_asmdata.getjumplabel(l2);
|
||||||
|
@ -2036,13 +2036,9 @@ implementation
|
|||||||
inherited ppuload(setdef,ppufile);
|
inherited ppuload(setdef,ppufile);
|
||||||
ppufile.getderef(elementdefderef);
|
ppufile.getderef(elementdefderef);
|
||||||
settype:=tsettype(ppufile.getbyte);
|
settype:=tsettype(ppufile.getbyte);
|
||||||
case settype of
|
savesize:=ppufile.getaint;
|
||||||
normset :
|
setbase:=ppufile.getaint;
|
||||||
savesize:=ppufile.getaint;
|
setmax:=ppufile.getaint;
|
||||||
varset,
|
|
||||||
smallset :
|
|
||||||
savesize:=ppufile.getlongint;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -2060,13 +2056,9 @@ implementation
|
|||||||
inherited ppuwrite(ppufile);
|
inherited ppuwrite(ppufile);
|
||||||
ppufile.putderef(elementdefderef);
|
ppufile.putderef(elementdefderef);
|
||||||
ppufile.putbyte(byte(settype));
|
ppufile.putbyte(byte(settype));
|
||||||
case settype of
|
ppufile.putaint(savesize);
|
||||||
varset,
|
ppufile.putaint(setbase);
|
||||||
smallset:
|
ppufile.putaint(setmax);
|
||||||
ppufile.putlongint(savesize);
|
|
||||||
normset:
|
|
||||||
ppufile.putaint(savesize);
|
|
||||||
end;
|
|
||||||
ppufile.writeentry(ibsetdef);
|
ppufile.writeentry(ibsetdef);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1940,12 +1940,19 @@ begin
|
|||||||
write (space,' Element type : ');
|
write (space,' Element type : ');
|
||||||
readderef;
|
readderef;
|
||||||
b:=getbyte;
|
b:=getbyte;
|
||||||
|
// skip savesize
|
||||||
|
getaint;
|
||||||
case tsettype(b) of
|
case tsettype(b) of
|
||||||
smallset : writeln(space,' Set with 32 Elements');
|
smallset : write(space,' SmallSet');
|
||||||
normset : writeln(space,' Set with 256 Elements');
|
normset : write(space,' NormalSet');
|
||||||
varset : writeln(space,' Set with ',getlongint,' Elements');
|
varset : write(space,' VarSet');
|
||||||
else writeln('!! Warning: Invalid set type ',b);
|
else writeln('!! Warning: Invalid set type ',b);
|
||||||
end;
|
end;
|
||||||
|
// set base
|
||||||
|
l:=getaint;
|
||||||
|
// set max
|
||||||
|
j:=getaint;
|
||||||
|
writeln(' with ',j-l,' elements');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ibvariantdef :
|
ibvariantdef :
|
||||||
|
@ -428,8 +428,8 @@ implementation
|
|||||||
location_freetemp(current_asmdata.CurrAsmList,left.location);
|
location_freetemp(current_asmdata.CurrAsmList,left.location);
|
||||||
|
|
||||||
if (opsize >= OS_S8) or { = if signed }
|
if (opsize >= OS_S8) or { = if signed }
|
||||||
((left.resultdef.typ=orddef) and (torddef(left.resultdef).high >= tsetdef(right.resultdef).setmax)) or
|
((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=enumdef) and (tenumdef(left.resultdef).max > tsetdef(right.resultdef).setmax)) then
|
||||||
begin
|
begin
|
||||||
|
|
||||||
{ we have to check if the value is < 0 or > setmax }
|
{ we have to check if the value is < 0 or > setmax }
|
||||||
|
16
tests/webtbs/tw8258a.pp
Normal file
16
tests/webtbs/tw8258a.pp
Normal 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.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user