diff lisp/byte-optimize.el @ 5663:0df4d95bd98a

Fetch its bytecode before unfolding a compiled function, byte-optimize.el lisp/ChangeLog addition: 2012-05-12 Aidan Kehoe <kehoea@parhasard.net> * byte-optimize.el (byte-compile-unfold-lambda): Fetch the bytecode before unfolding a compiled function, its body may have been compiled lazily thanks to byte-compile-dynamic. Thank you Mats Lidell and the package smoketest!
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 12 May 2012 15:03:24 +0100
parents 2a870a7b86bd
children b4715fcbe001
line wrap: on
line diff
--- a/lisp/byte-optimize.el	Thu May 10 13:53:06 2012 +0100
+++ b/lisp/byte-optimize.el	Sat May 12 15:03:24 2012 +0100
@@ -296,11 +296,12 @@
   (let ((lambda (car form))
 	(values (cdr form)))
     (if (compiled-function-p lambda)
-	(setq lambda (list 'lambda (compiled-function-arglist lambda)
-			  (list 'byte-code
-				(compiled-function-instructions lambda)
-				(compiled-function-constants lambda)
-				(compiled-function-stack-depth lambda)))))
+	(setq lambda (fetch-bytecode lambda)
+              lambda (list 'lambda (compiled-function-arglist lambda)
+                           (list 'byte-code
+                                 (compiled-function-instructions lambda)
+                                 (compiled-function-constants lambda)
+                                 (compiled-function-stack-depth lambda)))))
     (let ((arglist (nth 1 lambda))
 	  (body (cdr (cdr lambda)))
 	  optionalp restp