summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorAndrea Corallo <acorallo@gnu.org>2024-10-15 15:30:49 +0200
committerAndrea Corallo <acorallo@gnu.org>2024-10-15 22:13:08 +0200
commitcd739d3644be618008e5c369b4e96201a05a3d1b (patch)
treef52269c05330679eeb7d37176c7f637f9441f3cb /lisp/emacs-lisp
parent358b38bc17875c462c2131b9eeb85d3456c0be2b (diff)
downloademacs-cd739d3644be618008e5c369b4e96201a05a3d1b.tar.gz
emacs-cd739d3644be618008e5c369b4e96201a05a3d1b.tar.bz2
emacs-cd739d3644be618008e5c369b4e96201a05a3d1b.zip
Fix comp branch-optim pass (bug#73270)
* test/src/comp-tests.el (comp-test-73270-1): Define new test. * test/src/comp-resources/comp-test-funcs.el (comp-test-73270-base) (comp-test-73270-child1, comp-test-73270-child2) (comp-test-73270-child3, comp-test-73270-child4) (comp-test-73270-1-f): Define. * lisp/emacs-lisp/comp-cstr.el (comp-cstr-type-p): Fix it for nil cstrs.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/comp-cstr.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el
index 66c44f16835..b2eaf8cc423 100644
--- a/lisp/emacs-lisp/comp-cstr.el
+++ b/lisp/emacs-lisp/comp-cstr.el
@@ -950,9 +950,12 @@ Non memoized version of `comp-cstr-intersection-no-mem'."
(if-let ((pred (get type 'cl-deftype-satisfies)))
(and (null (range cstr))
(null (neg cstr))
- (and (or (null (typeset cstr))
- (equal (typeset cstr) `(,type)))
- (cl-every pred (valset cstr))))
+ (if (null (typeset cstr))
+ (and (valset cstr)
+ (cl-every pred (valset cstr)))
+ (when (equal (typeset cstr) `(,type))
+ ;; (valset cstr) can be nil as well.
+ (cl-every pred (valset cstr)))))
(error "Unknown predicate for type %s" type)))))
t))