Skip to content

Ruby: Fix CFG for nodes that may raise #16122

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

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Apr 4, 2024

The CFG for m16 below is wrong:

def m16(b1, b2)
  begin
    if b1 || b2 == true
      return 1
    else
      return 2
    end
  rescue ExceptionA
    return 3
  end
end

CFG before (erroneous edge highlighted):

image

CFG after:

image

@github-actions github-actions bot added the Ruby label Apr 4, 2024
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Apr 4, 2024
@hvitved hvitved marked this pull request as ready for review April 4, 2024 18:49
@hvitved hvitved requested a review from a team as a code owner April 4, 2024 18:49
@hvitved hvitved merged commit aa24c29 into github:main Apr 8, 2024
@hvitved hvitved deleted the ruby/cfg-may-raise-issue branch April 8, 2024 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Ruby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants