Correctly implement negative array indices, other bugfixes

- check for negative string lengths
- handle negative values for emitInc/emitDec
- bugfix for parseInteger with leading minus
- fix set literals containing variables as elements
This commit is contained in:
slederer 2025-03-31 00:47:34 +02:00
parent bb602043d2
commit 6d08db2933
2 changed files with 24 additions and 7 deletions

View file

@ -1250,7 +1250,7 @@ begin
(* nothing to do *)
end
else
if amount <= MaxTinyOffset then
if (amount > 0) and (amount <= MaxTinyOffset) then
emitIns2Int('INC', amount)
else
begin
@ -1266,7 +1266,7 @@ begin
(* nothing to do *)
end
else
if amount <= MaxTinyOffset then
if (amount > 0) and (amount <= MaxTinyOffset) then
emitIns2Int('DEC', amount)
else
begin