Commits

Aidan Kehoe committed 0df4d95

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!

Comments (0)

Files changed (2)

+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!
+
 2012-05-10  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* mule/mule-category.el (word-combining-categories):

lisp/byte-optimize.el

   (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