Skip to content

Add support for scanning exception regions #17

@vitek-karas

Description

@vitek-karas

Valid once #16 is merged.

Repro:
Update the repro program by changing Main to contain try/catch/finally and calling some new methods from the catch and finally regions.

Fix:

  • Work is done in MethodBodyNode.cs
  • Use bodyBlock.ExceptionRegions to get to the exception regions in the original method
  • Update GetStaticDependencies to report the catch clause type token dependency
  • Include exception regions when rewriting the method body in Write.
    • The code already uses InstructionEncoder so just add a ControlFlowBuilder to it
    • Use the ControlFlowBuilder to add labels for the try/catch/finally blocks
    • Add exception regions
    • Remap the catch clause type tokens

Don't forget (or add an issue for) about filter blocks.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions