Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
0181-beam_ssa_bool-Eliminate-compiler-crash.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0181-beam_ssa_bool-Eliminate-compiler-crash.patch of Package erlang
From 94732ebcac2897b8182211ad60ba9b66369c1074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Wed, 30 Mar 2022 14:01:26 +0200 Subject: [PATCH 6/8] beam_ssa_bool: Eliminate compiler crash --- lib/compiler/src/beam_ssa_bool.erl | 2 +- lib/compiler/test/guard_SUITE.erl | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/compiler/src/beam_ssa_bool.erl b/lib/compiler/src/beam_ssa_bool.erl index cc91e336e0..02c00b0e04 100644 --- a/lib/compiler/src/beam_ssa_bool.erl +++ b/lib/compiler/src/beam_ssa_bool.erl @@ -1455,7 +1455,7 @@ ensure_init_used_1([], _G, Acc) -> do_ensure_init_instr(#b_set{op=phi,args=Args}, _VarMap, InitMaps) -> - _ = [ensure_init_used(Var, map_get(From, InitMaps)) || + _ = [ensure_init_used(Var, maps:get(From, InitMaps, #{})) || {#b_var{}=Var,From} <- Args], ok; do_ensure_init_instr(#b_set{}=I, VarMap, _InitMaps) -> diff --git a/lib/compiler/test/guard_SUITE.erl b/lib/compiler/test/guard_SUITE.erl index c02ee131e7..5a4d8d1e80 100644 --- a/lib/compiler/test/guard_SUITE.erl +++ b/lib/compiler/test/guard_SUITE.erl @@ -2529,6 +2529,7 @@ beam_bool_SUITE(_Config) -> erl1384(), gh4788(), beam_ssa_bool_coverage(), + bad_map_in_guard(), gh_7252(), ok. @@ -3040,6 +3041,15 @@ beam_ssa_bool_coverage_1(V) when V andalso 0, tuple_size(0) -> beam_ssa_bool_coverage_1(_) -> error. +-record(bad_map_in_guard, {name}). +bad_map_in_guard() -> + error = bad_map_in_guard_1(). + +bad_map_in_guard_1() when (a#{key => value})#bad_map_in_guard.name -> + ok; +bad_map_in_guard_1() -> + error. + gh_7252() -> bar = gh_7252_a(id(bar), id([])), bar = gh_7252_a(id(bar), id(ok)), -- 2.34.1
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