mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 09:09:19 +02:00
Use aint type local variable in read_index_shift to avoid wrong typecast
git-svn-id: trunk@19576 -
This commit is contained in:
parent
33800a0b59
commit
3a7af29d3a
@ -212,6 +212,8 @@ Unit raarmgas;
|
|||||||
|
|
||||||
|
|
||||||
procedure read_index_shift(require_rbracket : boolean);
|
procedure read_index_shift(require_rbracket : boolean);
|
||||||
|
var
|
||||||
|
shift : aint;
|
||||||
begin
|
begin
|
||||||
case actasmtoken of
|
case actasmtoken of
|
||||||
AS_COMMA :
|
AS_COMMA :
|
||||||
@ -227,9 +229,10 @@ Unit raarmgas;
|
|||||||
if not(actasmtoken=AS_HASH) then
|
if not(actasmtoken=AS_HASH) then
|
||||||
do_error;
|
do_error;
|
||||||
Consume(AS_HASH);
|
Consume(AS_HASH);
|
||||||
oper.opr.ref.shiftimm := BuildConstExpression(false,true);
|
shift := BuildConstExpression(false,true);
|
||||||
if (oper.opr.ref.shiftimm<0) or (oper.opr.ref.shiftimm>32) then
|
if (shift<0) or (shift>32) then
|
||||||
do_error;
|
do_error;
|
||||||
|
oper.opr.ref.shiftimm := shift;
|
||||||
test_end(require_rbracket);
|
test_end(require_rbracket);
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user