# HG changeset patch # User Andreas Schwab # Date 1285607698 -7200 # Node ID 0e33b506a2f17f3c0fcac055eb96616f167e2a5f # Parent cf68fbaebcfe46166e3372381787d6478ee6665d * emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Avoid infinite recursion on erroneous lambda form. (Bug#7114) diff -r cf68fbaebcfe -r 0e33b506a2f1 lisp/ChangeLog --- a/lisp/ChangeLog Mon Sep 27 15:27:54 2010 +0200 +++ b/lisp/ChangeLog Mon Sep 27 19:14:58 2010 +0200 @@ -1,3 +1,8 @@ +2010-09-27 Andreas Schwab + + * emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Avoid + infinite recursion on erroneous lambda form. (Bug#7114) + 2010-09-27 Kenichi Handa * tar-mode.el (tar-header-block-tokenize): Decode filenames in diff -r cf68fbaebcfe -r 0e33b506a2f1 lisp/emacs-lisp/byte-opt.el --- 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