From c702e25a7a9e1ba2b75942dcc00402947757786d Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 8 Sep 2019 21:42:51 +0200 Subject: [PATCH] do not override existing basic blocks when branching backwards! --- lisp/emacs-lisp/comp.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 0770d32f7a1..c398810186d 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -500,9 +500,11 @@ If NEGATED non nil negate the tested condition." (comp-emit (if negated (list 'cond-jump a b target bb) (list 'cond-jump a b bb target))) - (puthash target - (make-comp-block :sp (+ target-offset (comp-sp))) - blocks) + (unless (gethash target blocks) + ;; Create the bb target only if does not exixsts already. + (puthash target + (make-comp-block :sp (+ target-offset (comp-sp))) + blocks)) (comp-mark-block-closed)) (comp-emit-block bb))) -- 2.39.5