* avoid range check errors

git-svn-id: trunk@39990 -
This commit is contained in:
florian 2018-10-20 10:17:34 +00:00
parent d4cf97a755
commit 116f36fe56
2 changed files with 4 additions and 3 deletions

View File

@ -377,7 +377,7 @@ implementation
function taddnode.simplify(forinline : boolean) : tnode;
function is_range_test(nodel, noder: taddnode; var value: tnode; var cl,cr: qword): boolean;
function is_range_test(nodel, noder: taddnode; var value: tnode; var cl,cr: Tconstexprint): boolean;
const
is_upper_test: array[ltn..gten] of boolean = (true,true,false,false);
inclusive_adjust: array[boolean,ltn..gten] of integer = ((1,0,-1,0),
@ -460,7 +460,7 @@ implementation
resultset : Tconstset;
res,
b : boolean;
cr, cl : qword;
cr, cl : Tconstexprint;
begin
result:=nil;
l1:=0;

View File

@ -159,7 +159,8 @@ Unit rappcgas;
End
Else
Begin
oper.opr.Ref.Offset:=BuildConstExpression(false,true);
{ cast explicitly to avoid range check errors }
oper.opr.Ref.Offset:=ASizeInt(BuildConstExpression(false,true));
Consume(AS_RPAREN);
if actasmtoken=AS_AT then
ReadAt(oper);