From 9c1526c3ccc5371a4bc6142f0ccf5579c7c28e98 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Fri, 18 Sep 2026 00:59:54 -0700 Subject: better behavior in the crash handler when the dictionary is messed up a lot more defensive bounds checks Force-Push: yes Change-Id: Ib900471b8befe06dfa7994714b94ab4ebdc3f0fa --- dynamic.e | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dynamic.e b/dynamic.e index d792137..cf27eb5 100644 --- a/dynamic.e +++ b/dynamic.e @@ -81,7 +81,7 @@ ~ (pointer -- entry pointer or 0) : containing-entry dup is-in-log { drop 0 exit } unless - latest @ { dup { 2dup > } { 0 } if-else } + latest @ { dup { 2dup > over is-in-log && } { 0 } if-else } { @ } while swap drop ; ~ (entry pointer -- boolean) @@ -238,7 +238,7 @@ : symbolize-pointer dup is-in-log { - dup containing-entry dup { + dup containing-entry dup is-in-log { ~ Any format we're going to use here starts with the entry's name; by ~ printing it now we don't have to keep track of it later. dup entry-to-name emitstring @@ -280,6 +280,10 @@ : list-callers + control@ r0 @ < + control@ log @ > || + { ." control stack pointer out of range: " control@ .hex64 newline } if + control@ { dup r0 @ > } { dup @ symbolize-pointer newline 8 + } while drop ; -- cgit 1.4.1