diff --git a/compiler/ir1util.lisp b/compiler/ir1util.lisp
index da35d2c6dc8b1e82ac006ec302d69ee363f593b8..7c223b179edd48c36ac0fec0bd00ea91e113e1cc 100644
--- a/compiler/ir1util.lisp
+++ b/compiler/ir1util.lisp
@@ -1085,6 +1085,7 @@
       (let ((form root)
 	    (current (rest rpath)))
 	(loop
+	  (when (null current) (return))
 	  (let ((head (first form)))
 	    (when (symbolp head)
 	      (let ((name (symbol-name head)))
@@ -1099,8 +1100,6 @@
 				   (car next)
 				   next))))
 		      (context (list head)))))))
-	  
-	  (when (null current) (return))
 	  (setq form (nth (pop current) form)))
 	
 	(cond ((context)