Skip to content

potential fix for try - branch - catch#128

Open
maartenvd wants to merge 1 commit into
FluxML:masterfrom
maartenvd:patch-2
Open

potential fix for try - branch - catch#128
maartenvd wants to merge 1 commit into
FluxML:masterfrom
maartenvd:patch-2

Conversation

@maartenvd

Copy link
Copy Markdown

I must admit I don't fully understand the ssa! pass, but there is an issue where try ... can branch. handlers/catch_branches will be incorrect for those branches. Example:

met = IRTools.meta(Tuple{typeof(Base.Partr.multiq_size), Int8})
ir = IRTools.IR(met)

Again, I don't fully understand the pass, and this 'fix' may break other things!

I imagine that it is possible for a branch to jump back to an earlier branch, and catch_branches will then be completely wrong!

@codecov

codecov Bot commented Jul 12, 2024

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.19%. Comparing base (8f5f50e) to head (8ca9f1f).
⚠️ Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #128      +/-   ##
==========================================
+ Coverage   73.61%   75.19%   +1.58%     
==========================================
  Files          16       16              
  Lines        1512     1532      +20     
==========================================
+ Hits         1113     1152      +39     
+ Misses        399      380      -19     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Pangoraw

Copy link
Copy Markdown
Collaborator

but there is an issue where try ... can branch. handlers/catch_branches

yeah, the ssa! pass seems to be written with the assumption that there is only one leave per try region (+1 leave in the catch region) which is not the case when there is a return in the try.

Here is a minimal reproducer which you can add as a test:

function f(cond)
   try
       if cond return end
   finally
   end
end

I am not sure about this fix, though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants