diff --git a/code/debug-int.lisp b/code/debug-int.lisp
index 485cde3e595791cd6fb8b3a11d67d15e685ec327..dc30864428ffc8b493b2cf1bbb9fc7a88962176d 100644
--- a/code/debug-int.lisp
+++ b/code/debug-int.lisp
@@ -792,6 +792,10 @@
 	    (loop
 	      (when (or (= i len)
 			(< pc (if elsewhere-p
+				  #+rt-target
+				  (1+ (c::compiled-debug-function-elsewhere-pc
+				       (svref function-map (1+ i))))
+				  #-rt-target
 				  (c::compiled-debug-function-elsewhere-pc
 				   (svref function-map (1+ i)))
 				  (svref function-map i))))