From f0290502f3354f9ed7e8ec84c24ac13a7bad2fc0 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sat, 28 Dec 2019 13:51:46 +0100 Subject: [PATCH] disable propagation when non locals are present --- lisp/emacs-lisp/comp.el | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 9272bcc0021..f63e5842bc5 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1609,13 +1609,15 @@ Return t if something was changed." (defun comp-propagate (_) (when (>= comp-speed 2) (maphash (lambda (_ f) - (let ((comp-func f)) - (comp-basic-const-propagate) - (cl-loop - for i from 1 - while (comp-propagate*) - finally (comp-log (format "Propagation run %d times\n" i) 2)) - (comp-log-func comp-func 3))) + ;; FIXME remove the following condition when tested. + (unless (comp-func-has-non-local f) + (let ((comp-func f)) + (comp-basic-const-propagate) + (cl-loop + for i from 1 + while (comp-propagate*) + finally (comp-log (format "Propagation run %d times\n" i) 2)) + (comp-log-func comp-func 3)))) (comp-ctxt-funcs-h comp-ctxt)))) @@ -1780,13 +1782,15 @@ These are substituted with a normal 'set' op." (when (>= comp-speed 2) (maphash (lambda (_ f) (let ((comp-func f)) - (cl-loop - for i from 1 - while (comp-dead-assignments-func) - finally (comp-log (format "dead code rm run %d times\n" i) 2) - (comp-log-func comp-func 3)) - (comp-remove-type-hints-func) - (comp-log-func comp-func 3))) + ;; FIXME remove the following condition when tested. + (unless (comp-func-has-non-local comp-func) + (cl-loop + for i from 1 + while (comp-dead-assignments-func) + finally (comp-log (format "dead code rm run %d times\n" i) 2) + (comp-log-func comp-func 3)) + (comp-remove-type-hints-func) + (comp-log-func comp-func 3)))) (comp-ctxt-funcs-h comp-ctxt)))) -- 2.39.5