-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eliminate crash for nested guards in record initialization #8196
Eliminate crash for nested guards in record initialization #8196
Conversation
CT Test Results 2 files 93 suites 34m 34s ⏱️ Results for commit 1b23ddb. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
Thanks for the fix. -record(r0, {rf0}).
-record(r1, {
rf1 = fun
(0.0) ->
(list_to_bitstring(ok))#r0.rf0;
(_) when ok ->
ok
end
}).
f() ->
<<0 || (#r1{})>>. still fails, and now its error message is
I don't know whether it is a related bug, or a different one that was masked by the issue in erl_expand_records. |
fa50647
to
c8dd54f
Compare
I've updated the pull request to fix the second bug too. |
Two other related crashes were found overnight: -record(r0, {rf0}).
-record(r1, {
rf0 = {
((ok)#r0{})#r0.rf0,
case ok of
_ when ok ->
ok
end
}
}).
f() ->
#{ok => ok || (#r1{})}. and -record(r0, {rf0}).
-record(r1, {
rf0 =
(begin
((_ = ok)#r0.rf0),
(try
ok
catch
_ when ok ->
ok
end)
end)
}).
f() ->
#{ok => ok || (#r1{})}. crash with this PR with
Without the PR, they crash with the same error message as the original testcase. |
Also fix other bugs in the `erl_expand_records` pass hidden behind the original bug. Closes erlang#8190
c8dd54f
to
1b23ddb
Compare
I've force-pushed another update to fix the last two crashes. |
Closes #8190