Subject: Re: bug#21083: 24.5; Infinite loop in called-interactively-p
From: Stefan Monnier <[email-masked]>
To: Dmitri Paduchikh <[email-masked]>
Cc: [email-masked]
Date: Tue, 21 Jul 2015 19:10:07 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

> I have prepared a simple example to reproduce the problem. In the
> attachment is a small elisp file testfile.el. Save it and execute:

Thanks, that made it easy.

I installed the patch below which should fix the inf-loop.

        Stefan

diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el
index a6db5e9..5a59a98 100644
--- a/lisp/emacs-lisp/nadvice.el
+++ b/lisp/emacs-lisp/nadvice.el
@@ -522,8 +522,9 @@ of the piece of advice."
             (while
                 (progn
                   (funcall get-next-frame)
-                  (not (and (eq (nth 1 frame2) 'apply)
-                            (eq (nth 3 frame2) inneradvice)))))
+                  (and frame2
+                       (not (and (eq (nth 1 frame2) 'apply)
+                                 (eq (nth 3 frame2) inneradvice))))))
             (funcall get-next-frame)
             (funcall get-next-frame))))
       (- i origi 1))))