From 2f339dca4935ed52cfb4a8eba000319e4e03943b Mon Sep 17 00:00:00 2001 From: crc Date: Fri, 18 Sep 2020 12:03:40 +0000 Subject: [PATCH] retro.py: fix bug in i_fe() that was misreporting the stack depth (fixes `dump-stack`, as reported by Scott McCallum) FossilOrigin-Name: 0a3728a36a36c74ea4f5573271acb1524635344f3fabf379cdd665477da1d1f1 --- README | 3 ++- RELEASE-NOTES | 4 ++++ vm/nga-python/retro.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README b/README index 5c471f2..0f749a7 100644 --- a/README +++ b/README @@ -102,5 +102,6 @@ app store fees, hardware). Thanks go out to my current and past patrons: - Kiyoshi YONEDA -- Rick - Krinkleneck +- Rick +- Scott MCCallum diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ba416d9..aa783e4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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) diff --git a/vm/nga-python/retro.py b/vm/nga-python/retro.py index b210a1f..4698c5a 100755 --- a/vm/nga-python/retro.py +++ b/vm/nga-python/retro.py @@ -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