Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
1007-Fix-crash-in-beam_bool.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1007-Fix-crash-in-beam_bool.patch of Package erlang
From 1ee690bef4c44eeb72c958a517a156cfb45600b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Tue, 26 Jul 2022 13:12:36 +0200 Subject: [PATCH] Fix crash in beam_bool Fixes #6164 --- lib/compiler/src/beam_ssa_bool.erl | 7 +++++-- lib/compiler/test/guard_SUITE.erl | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/compiler/src/beam_ssa_bool.erl b/lib/compiler/src/beam_ssa_bool.erl index 6efab4fd07..7a7209e197 100644 --- a/lib/compiler/src/beam_ssa_bool.erl +++ b/lib/compiler/src/beam_ssa_bool.erl @@ -1066,10 +1066,13 @@ redirect_test(Bool, SuccFail, G0, St) -> redirect_test_1(V, SuccFail, G) -> case get_targets(V, G) of {br,_Succ,Fail} -> - %% I have only seen this happen in code generated by LFE - %% (in lfe_andor_SUITE.core and lfe_guard_SUITE.core) + %% This is rare when compiling from Erlang code. It is + %% more frequent for generated by another code generator + %% such as the one in LFE (see lfe_andor_SUITE.core and + %% lfe_guard_SUITE.core). case SuccFail of {fail,Fail} -> G; + {fail,_} -> not_possible(); {succ,_} -> not_possible() end; {br,Next} -> diff --git a/lib/compiler/test/guard_SUITE.erl b/lib/compiler/test/guard_SUITE.erl index ba89255e7b..9664b4cbfd 100644 --- a/lib/compiler/test/guard_SUITE.erl +++ b/lib/compiler/test/guard_SUITE.erl @@ -2312,6 +2312,7 @@ beam_bool_SUITE(_Config) -> erl1253(), erl1384(), gh4788(), + gh_6164(), ok. before_and_inside_if() -> @@ -2802,6 +2803,23 @@ do_gh4788(N) -> end, ok. +gh_6164() -> + true = do_gh_6164(id([])), + {'EXIT',{{case_clause,42},_}} = catch do_gh_6164(id(0)), + + ok. + +do_gh_6164(V1) -> + case 42 of + V2 -> + case is_list(V1) of + V3 -> + case V3 orelse V2 of + _ when V3 -> 100 + end =< V3 + end + end. + %%% %%% End of beam_bool_SUITE tests. %%% -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor