[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#30872: incorrect byte-compile of closure called from local funcalled
From: |
Noam Postavsky |
Subject: |
bug#30872: incorrect byte-compile of closure called from local funcalled function |
Date: |
Wed, 30 May 2018 18:55:33 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
I narrowed it down a bit more, note the lack of setq in the result of
byte-compile-preprocess:
(byte-compile-preprocess
'#'(lambda (handle-fun arg)
(let* ((subfun #'(lambda (params)
(ignore handle-fun)
(funcall #'(lambda () (setq params nil)))
params)))
(funcall subfun arg))))
;=>
#'(lambda (handle-fun arg)
(let* ((subfun
#'(lambda (handle-fun params)
(ignore handle-fun)
(funcall
(internal-make-closure nil
(params)
nil nil))
params)))
(funcall subfun handle-fun arg)))
It's hitting this bit of code in cconv.el, where it says this "should
never happen":
(defun cconv-convert (form env extend)
(pcase form
[...]
(`(setq . ,forms) ; setq special form
[...]
(push (pcase sym-new
((pred symbolp) `(setq ,sym-new ,value))
(`(car-safe ,iexp) `(setcar ,iexp ,value))
;; This "should never happen", but for variables which are
;; mutated+captured+unused, we may end up trying to `setq'
;; on a closed-over variable, so just drop the setq.
(_ ;; (byte-compile-report-error
;; (format "Internal error in cconv of (setq %s ..)"
;; sym-new))
value))
Stefan, thoughts?
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#30872: incorrect byte-compile of closure called from local funcalled function,
Noam Postavsky <=