Skip to content
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

Open
wants to merge 2 commits into
base: maint-27
Choose a base branch
from

Commits on Nov 26, 2024

  1. compiler destructive update: Fix bug in handling of nested patches

    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.
    frej committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    1c354d2 View commit details
    Browse the repository at this point in the history
  2. compiler destructive update: Handle nested patches for phis

    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
    frej committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    4d6e406 View commit details
    Browse the repository at this point in the history