From 8eb2371ce15670e0cbc41c3caf347970051ec978 Mon Sep 17 00:00:00 2001 From: Jared Miller Date: Mon, 9 Feb 2026 21:05:27 -0500 Subject: [PATCH] Add stack and local_vars to ZStackBottom sentinel ZStackBottom lacked attributes that normal stack operations need when returning from a subroutine to the top level. Zork 1 hit this on the first subroutine return during startup. --- src/mudlib/zmachine/zstackmanager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mudlib/zmachine/zstackmanager.py b/src/mudlib/zmachine/zstackmanager.py index a986733..df7350f 100644 --- a/src/mudlib/zmachine/zstackmanager.py +++ b/src/mudlib/zmachine/zstackmanager.py @@ -96,6 +96,8 @@ class ZRoutine: class ZStackBottom: def __init__(self): self.program_counter = 0 # used as a cache only + self.stack = [] + self.local_vars = [0 for _ in range(15)] class ZStackManager: