retro.py: fix bug in i_fe() that was misreporting the stack depth (fixes dump-stack, as reported by Scott McCallum)

FossilOrigin-Name: 0a3728a36a36c74ea4f5573271acb1524635344f3fabf379cdd665477da1d1f1
This commit is contained in:
crc 2020-09-18 12:03:40 +00:00
parent ef9bedc247
commit 2f339dca49
3 changed files with 7 additions and 2 deletions

3
README
View file

@ -102,5 +102,6 @@ app store fees, hardware).
Thanks go out to my current and past patrons:
- Kiyoshi YONEDA
- Rick
- Krinkleneck
- Rick
- Scott MCCallum

View file

@ -33,3 +33,7 @@ Unix
- io:float-operation (now float:operation)
- io:socket-operation (now socket:operation)
Python
- fixed a bug in the stack depth reporting (thanks to Scott McCallum for
noticing this)

View file

@ -142,7 +142,7 @@ def i_gt():
def i_fe():
global ip, memory, stack, address
if stack[-1] == -1: stack[-1] = len(stack)
if stack[-1] == -1: stack[-1] = len(stack) - 1
elif stack[-1] == -2: stack[-1] = len(address)
elif stack[-1] == -3: stack[-1] = len(memory)
elif stack[-1] == -4: stack[-1] = -2147483648