diff lisp/emacs-lisp/byte-opt.el @ 110625:0e33b506a2f1

* emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Avoid infinite recursion on erroneous lambda form. (Bug#7114)
author Andreas Schwab <schwab@linux-m68k.org>
date Mon, 27 Sep 2010 19:14:58 +0200
parents 1d1d5d9bd884
children 6a7fb61524be cda2045a5ee8
line wrap: on
line diff
--- a/lisp/emacs-lisp/byte-opt.el	Mon Sep 27 15:27:54 2010 +0200
+++ b/lisp/emacs-lisp/byte-opt.el	Mon Sep 27 19:14:58 2010 +0200
@@ -381,9 +381,11 @@
 		form))
 	  ((or (byte-code-function-p fn)
 	       (eq 'lambda (car-safe fn)))
-           (byte-optimize-form-code-walker
-            (byte-compile-unfold-lambda form)
-            for-effect))
+	   (let ((newform (byte-compile-unfold-lambda form)))
+	     (if (eq newform form)
+		 ;; Some error occured, avoid infinite recursion
+		 form
+	       (byte-optimize-form-code-walker newform for-effect))))
 	  ((memq fn '(let let*))
 	   ;; recursively enter the optimizer for the bindings and body
 	   ;; of a let or let*.  This for depth-firstness: forms that