-
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
Fix error in compiler's destructive update pass #9111
base: maint-27
Are you sure you want to change the base?
Conversation
While refactoring the code responsible for merging patches to different elements of a literal in function calls in order to reuse it to solve issue erlang#9100, it was discovered that it only correctly handle patches to top-level elements. If multiple elements of a tuple inside another tuple was patched, it would crash. This commit fixes the above mentioned bug and also refactors the code to separate the parts that are specific to handle function arguments from the parts that merges patches to literals. The correctness of the refactoring is tested by already existing tests. A test case verifying the fix will be added in the patch addressing erlang#9100 as is it not worthwhile to spend the time to construct a test-case testing each of the issues separately.
The code responsible for patching Phi-instructions could not handle multiple patches to a single literal value, it silently discarded all but one of the updates. This MR corrects this by merging patches, using the same mechanism as used for patching function arguments. Closes erlang#9100
CT Test Results 2 files 324 suites 9m 23s ⏱️ Results for commit 4d6e406. ♻️ 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 |
The failing osv-scan test points to another project's build file which we apparently use as a smoke test. As this patch doesn't touch that part I'll ignore that failure. |
Thanks! Added both branches to our daily builds. |
Merged to |
As reported in #9100, an error in the compiler's destructive update pass could lead to crashes at runtime. This is a fix against the maintenance branch for OTP-27 . It is rooted in OTP-27.1.2, as usual it doesn't apply cleanly against master, so to help the person doing the forward merge, this gh9100 branch shows what should end up in master.