Skip to content
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

[ILVerify] Reporting verification error on protected blocks with more than one handler #64582

Closed
wants to merge 1 commit into from

Conversation

TIHan
Copy link
Contributor

@TIHan TIHan commented Jan 31, 2022

Adds an additional check in ILVerify as described here: #63198 (comment)

Description

ECMA-335 states:

I.12.4.2 Exception handling
There are four kinds of handlers for protected blocks. A single protected block shall have exactly
one handler associated with it
:

  • A finally handler that shall be executed whenever the block exits, regardless of
    whether that occurs by normal control flow or by an unhandled exception.
  • A fault handler that shall be executed if an exception occurs, but not on completion of
    normal control flow.
  • A catch handler that handles any exception of a specified class or any of its sub-classes.
  • A filter handler that runs a user-specified set of CIL instructions to determine if the
    exception should be handled by the associated handler, or passed on to the next
    protected block.

Currently, ILVerify does not check for A single protected block shall have exactly one handler associated with it, and the assembly would pass verification if a try block had more than one handler.

Acceptance Criteria

  • Add tests

@ghost ghost assigned TIHan Jan 31, 2022
@TIHan TIHan changed the title [WIP][ILVerify] Reporting verification error on protected blocks with more than one handler [ILVerify] Reporting verification error on protected blocks with more than one handler Feb 11, 2022
@jkotas jkotas added the area-Tools-ILVerification Issues related to ilverify tool and IL verification in general label Feb 21, 2022
@ghost
Copy link

ghost commented Feb 21, 2022

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details

Adds an additional check in ILVerify as described here: #63198 (comment)

Description

ECMA-335 states:

I.12.4.2 Exception handling
There are four kinds of handlers for protected blocks. A single protected block shall have exactly
one handler associated with it
:

  • A finally handler that shall be executed whenever the block exits, regardless of
    whether that occurs by normal control flow or by an unhandled exception.
  • A fault handler that shall be executed if an exception occurs, but not on completion of
    normal control flow.
  • A catch handler that handles any exception of a specified class or any of its sub-classes.
  • A filter handler that runs a user-specified set of CIL instructions to determine if the
    exception should be handled by the associated handler, or passed on to the next
    protected block.

Currently, ILVerify does not check for A single protected block shall have exactly one handler associated with it, and the assembly would pass verification if a try block had more than one handler.

Acceptance Criteria

  • Add tests
Author: TIHan
Assignees: TIHan
Labels:

area-crossgen2-coreclr, area-ILVerification

Milestone: -

@TIHan TIHan marked this pull request as draft March 14, 2022 15:51
@ghost
Copy link

ghost commented Apr 13, 2022

Draft Pull Request was automatically closed for inactivity. Please let us know if you'd like to reopen it.

@ghost ghost closed this Apr 13, 2022
@ghost ghost locked as resolved and limited conversation to collaborators May 13, 2022
@TIHan TIHan reopened this Jun 6, 2022
@TIHan TIHan marked this pull request as ready for review June 6, 2022 23:39
@TIHan TIHan added this to the 8.0.0 milestone Jun 6, 2022
@JulieLeeMSFT
Copy link
Member

@TIHan you moved this to .NET 8. Please make this as a draft PR.

@TIHan TIHan modified the milestones: 8.0.0, Future Jul 5, 2022
@JulieLeeMSFT JulieLeeMSFT marked this pull request as draft July 18, 2022 17:45
@ghost ghost closed this Aug 17, 2022
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Tools-ILVerification Issues related to ilverify tool and IL verification in general
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants