m68k: fixed parsing of absolute addresses in the assembler reader

git-svn-id: trunk@47418 -
This commit is contained in:
Károly Balogh 2020-11-15 03:43:26 +00:00 committed by Karoly Balogh
parent fc78671215
commit 538b8e8e71

View File

@ -1127,10 +1127,17 @@ const
end;
else
begin
if actasmtoken in [AS_COMMA,AS_SEPARATOR] then
begin
{ no longer in an expression }
if not ErrorFlag then
BuildRefExpression := CalculateExpression(expr);
exit;
end;
{ write error only once. }
if not errorflag then
Message(asmr_e_invalid_constant_expression);
if actasmtoken in [AS_COMMA,AS_SEPARATOR] then exit;
{ consume tokens until we find COMMA or SEPARATOR }
errorflag := true;
end;
@ -1400,7 +1407,7 @@ const
Message(asmr_e_invalid_operand_type);
{ identifiers are handled by BuildExpression }
oper.opr.typ := OPR_CONSTANT;
l:=BuildExpression(true,@tempstr);
l:=BuildExpression(true,@tempstr);
oper.opr.val :=aint(l);
if tempstr<>'' then
begin
@ -1411,13 +1418,13 @@ const
end;
end;
{ // Constant memory offset . // }
{ // This must absolutely be followed by ( // }
AS_HEXNUM,AS_INTNUM,
AS_BINNUM,AS_OCTALNUM,AS_PLUS:
begin
Oper.InitRef;
oper.opr.ref.offset:=BuildRefExpression;
BuildReference(oper);
if actasmtoken = AS_LPAREN then
BuildReference(oper);
end;
{ // A constant expression, or a Variable ref. // }
AS_ID: begin