From 24641e414030efb2eabff80ab15dbd1e1fae929a Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Mon, 15 Jan 2018 21:03:46 +0300 Subject: [PATCH] Protect unconvert-tail-calls against deleted blocks. Fixes lp#1742190. --- src/compiler/locall.lisp | 1 + tests/compiler-2.pure.lisp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/compiler/locall.lisp b/src/compiler/locall.lisp index 46bc995b8..41985f203 100644 --- a/src/compiler/locall.lisp +++ b/src/compiler/locall.lisp @@ -1039,6 +1039,7 @@ (let ((this-call (node-dest ref))) (when (and this-call (node-tail-p this-call) + (not (node-to-be-deleted-p this-call)) (eq (node-home-lambda this-call) fun)) (setf (node-tail-p this-call) nil) (ecase (functional-kind called) diff --git a/tests/compiler-2.pure.lisp b/tests/compiler-2.pure.lisp index fa8fecf29..27a1d74f6 100644 --- a/tests/compiler-2.pure.lisp +++ b/tests/compiler-2.pure.lisp @@ -1030,3 +1030,12 @@ `(lambda () (handler-case (declare))) :allow-failure t)))) + +(with-test (:name (:unconvert-tail-calls :deleted-call)) + (assert (nth-value 1 + (checked-compile + '(lambda () + (labels ((%f (&optional (x (* 2 nil (%f)))) x)) + (%f) + (%f 1))) + :allow-warnings t)))) -- 2.11.4.GIT