pastojs: fixed assign external const to int

This commit is contained in:
mattias 2021-09-19 17:27:34 +02:00
parent a46261bc15
commit a13694988d

View File

@ -24849,13 +24849,14 @@ begin
try try
if Value<>nil then if Value<>nil then
begin begin
if Value.Kind=revkInt then case Value.Kind of
revkInt:
begin begin
IntValue:=TResEvalInt(Value).Int; IntValue:=TResEvalInt(Value).Int;
if (IntValue>=LeftMinVal) and (IntValue<=LeftMaxVal) then if (IntValue>=LeftMinVal) and (IntValue<=LeftMaxVal) then
exit; exit;
end end;
else if Value.Kind=revkUInt then revkUInt:
begin begin
if TResEvalUInt(Value).UInt<=HighIntAsUInt then if TResEvalUInt(Value).UInt<=HighIntAsUInt then
begin begin
@ -24869,9 +24870,12 @@ begin
{$ELSE} {$ELSE}
IntValue:=PMaxPrecInt(@TResEvalUInt(Value).UInt)^; IntValue:=PMaxPrecInt(@TResEvalUInt(Value).UInt)^;
{$ENDIF} {$ENDIF}
end end;
revkExternal:
exit;
else else
RaiseNotSupported(El.right,AssignContext,20210815204203,'right='+Value.AsDebugString); RaiseNotSupported(El.right,AssignContext,20210815204203,'right='+Value.AsDebugString);
end;
case LeftBT of case LeftBT of
btByte: IntValue:=IntValue and $FF; // Note: "and" handles negative numbers btByte: IntValue:=IntValue and $FF; // Note: "and" handles negative numbers