From c19f76a18bb56236a4e043928598dcac5831aa14 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 27 Sep 2010 19:14:58 +0200 Subject: [PATCH] * emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Avoid infinite recursion on erroneous lambda form. (Bug#7114) --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/byte-opt.el | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0bbc1648de..45f32afa0a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index e461010a6c..4950511ebe 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -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 -- 2.20.1