summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--dynamic.e8
1 files 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 ;