Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix compilation of catches with multiple handlers #1973
The Cmm and Mach representations have recently been updated to allow static catch constructions to contain more than one handler. There is currently no code that takes advantage of this feature, and as a result it is not well tested.
This pull request fixes a bug in the transformation of these multiple handlers to linear code.
The bug cannot be triggered from OCaml code currently, but the Cmm parser included in the testsuite already supported the feature, so I added a test program that would produce wrong code without this patch.
chambart left a comment
This is an obvious fix. The code is ok and comes with a test. I'm all for it. This is not urgent as the situation generating this doesn't happen in the current compiler, but this is required by future optimizations.