Repository navigation
[ILLink analyzer] Fix dataflow tracking for nested finally regions - #94101
Conversation
|
Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar Issue DetailsFixes a bug I encountered while adding some new tests for feature checks. While analyzing finally regions in the mode where they will not exit normally, we weren't correctly propagating dataflow states through nested finally regions. See dotnet/linker#2481 for original context around the analysis done here.
|
| ProducedBy = Tool.Analyzer)] | ||
| [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()")] | ||
| [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()")] | ||
| static void CatchInFinally () { |
There was a problem hiding this comment.
This is just a test I added while looking at the related logic.
| } finally { | ||
| t = GetWithPublicFields (); | ||
| } | ||
| RequireAll3 (t); // fields only |
There was a problem hiding this comment.
Before this fix, RequireAll3 was warning about GetWithPublicMethods not satisfying All.
There was a problem hiding this comment.
Just to confirm - the warning was raised when processing the finally exception state, right? The "normal" state path didn't produce the warning because it already propagates it through predecessor's finally blocks.
There was a problem hiding this comment.
That's right on both counts
Extract code to shared helper
|
Failure is #94281 |
Fixes a bug I encountered while adding some new tests for feature checks.
While analyzing finally regions in the mode where they will not exit normally, we weren't correctly propagating dataflow states through nested finally regions. See dotnet/linker#2481 for original context around the analysis done here.