mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 09:29:26 +02:00
pastojs: fixed assign external const to int
This commit is contained in:
parent
a46261bc15
commit
a13694988d
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user