* fixed range check errors

This commit is contained in:
Jonas Maebe 2001-10-04 14:33:28 +00:00
parent 49ae9f925e
commit bdf2593265
4 changed files with 27 additions and 18 deletions

View File

@ -212,7 +212,7 @@ unit cgcpu;
begin begin
if ref.is_immediate then if ref.is_immediate then
a_load_const_reg(list,size,ref.offset,reg) a_load_const_reg(list,size,aword(ref.offset),reg)
else else
begin begin
sizes2load(size,regsize(reg),op,s); sizes2load(size,regsize(reg),op,s);
@ -426,7 +426,7 @@ unit cgcpu;
begin begin
if ref.is_immediate then if ref.is_immediate then
a_op_const_reg(list,op,ref.offset,reg) a_op_const_reg(list,op,aword(ref.offset),reg)
else else
begin begin
case op of case op of
@ -708,7 +708,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.3 2001-09-30 16:17:18 jonas Revision 1.4 2001-10-04 14:33:28 jonas
* fixed range check errors
Revision 1.3 2001/09/30 16:17:18 jonas
* made most constant and mem handling processor independent * made most constant and mem handling processor independent
Revision 1.2 2001/09/29 21:32:19 jonas Revision 1.2 2001/09/29 21:32:19 jonas

View File

@ -657,15 +657,11 @@ implementation
emitcall('FPC_DECREF'); emitcall('FPC_DECREF');
end; end;
{$ifdef regallocfix}
concatcopy(right.location.reference,
left.location.reference,left.resulttype.def.size,true,false);
ungetiftemp(right.location.reference);
{$Else regallocfix}
concatcopy(right.location.reference, concatcopy(right.location.reference,
left.location.reference,left.resulttype.def.size,false,false); left.location.reference,left.resulttype.def.size,false,false);
del_reference(left.location.reference);
del_reference(right.location.reference);
ungetiftemp(right.location.reference); ungetiftemp(right.location.reference);
{$endif regallocfix}
end; end;
end; end;
{$ifdef SUPPORT_MMX} {$ifdef SUPPORT_MMX}
@ -1088,7 +1084,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.22 2001-09-09 08:51:09 jonas Revision 1.23 2001-10-04 14:33:28 jonas
* fixed range check errors
Revision 1.22 2001/09/09 08:51:09 jonas
* fixed bug with assigning ansistrings (left^.location was released too * fixed bug with assigning ansistrings (left^.location was released too
early, caused bug reported by Aleksey V. Vaneev in mailing list on early, caused bug reported by Aleksey V. Vaneev in mailing list on
2001/09/07 regarding 'problems with nested procedures and local vars' 2001/09/07 regarding 'problems with nested procedures and local vars'

View File

@ -52,7 +52,7 @@ interface
cutils,verbose, cutils,verbose,
aasm,symconst,symdef, aasm,symconst,symdef,
ncon,ncal, ncon,ncal,
cpubase, cpubase,cpuinfo,
pass_2, pass_2,
cgbase, cgbase,
cga,cgobj,cgcpu, cga,cgobj,cgcpu,
@ -399,10 +399,10 @@ interface
end; end;
getlabel(l1); getlabel(l1);
cg.a_cmp_const_reg_label(exprasmlist,OS_32,OC_EQ,0,hreg,l1); cg.a_cmp_const_reg_label(exprasmlist,OS_32,OC_EQ,0,hreg,l1);
cg.a_op_const_reg(exprasmlist,OP_ADD, cg.a_op_const_reg(exprasmlist,OP_ADD,aword(
tobjectdef(left.resulttype.def).implementedinterfaces.ioffsets( tobjectdef(left.resulttype.def).implementedinterfaces.ioffsets(
tobjectdef(left.resulttype.def).implementedinterfaces.searchintf( tobjectdef(left.resulttype.def).implementedinterfaces.searchintf(
resulttype.def))^,hreg); resulttype.def))^),hreg);
cg.a_label(exprasmlist,l1); cg.a_label(exprasmlist,l1);
location.loc:=LOC_REGISTER; location.loc:=LOC_REGISTER;
location.register:=hreg; location.register:=hreg;
@ -422,7 +422,10 @@ end.
{ {
$Log$ $Log$
Revision 1.2 2001-09-30 16:16:28 jonas Revision 1.3 2001-10-04 14:33:28 jonas
* fixed range check errors
Revision 1.2 2001/09/30 16:16:28 jonas
- removed unused units form uses-clause and unused local vars - removed unused units form uses-clause and unused local vars
Revision 1.1 2001/09/29 21:32:47 jonas Revision 1.1 2001/09/29 21:32:47 jonas

View File

@ -69,7 +69,7 @@ implementation
verbose,globals,systems, verbose,globals,systems,
symconst,symdef,symsym,aasm,types, symconst,symdef,symsym,aasm,types,
cgbase,temp_gen,pass_2, cgbase,temp_gen,pass_2,
cpubase,cpuasm, cpubase,cpuasm,cpuinfo,
nld,ncon, nld,ncon,
cga,tgcpu, cga,tgcpu,
{$ifdef i386} {$ifdef i386}
@ -289,7 +289,8 @@ implementation
if not(omitfirstcomp) then if not(omitfirstcomp) then
begin begin
cg.a_cmp_const_loc_label(exprasmlist,opsize,hcond, cg.a_cmp_const_loc_label(exprasmlist,opsize,hcond,
tordconstnode(right).value,t2.location,aktbreaklabel); aword(tordconstnode(right).value),
t2.location,aktbreaklabel);
end; end;
end; end;
@ -332,7 +333,7 @@ implementation
else else
begin begin
cg.a_cmp_const_loc_label(exprasmlist,opsize,hcond, cg.a_cmp_const_loc_label(exprasmlist,opsize,hcond,
tordconstnode(right).value,t2.location,aktbreaklabel); aword(tordconstnode(right).value),t2.location,aktbreaklabel);
end; end;
{ according to count direction DEC or INC... } { according to count direction DEC or INC... }
{ must be after the test because of 0 to 255 for bytes !! } { must be after the test because of 0 to 255 for bytes !! }
@ -581,7 +582,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.2 2001-09-30 16:19:58 jonas Revision 1.3 2001-10-04 14:33:28 jonas
* fixed range check errors
Revision 1.2 2001/09/30 16:19:58 jonas
- removed unused units - removed unused units
Revision 1.1 2001/09/28 20:39:33 jonas Revision 1.1 2001/09/28 20:39:33 jonas