Skip to content

Delete SCAN contract annotations #116182

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

Merged
merged 3 commits into from
Jun 8, 2025
Merged

Delete SCAN contract annotations #116182

merged 3 commits into from
Jun 8, 2025

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented May 31, 2025

These annotations were used by prefast plugin that analyzed contract consistency. This prefast plugin is not coming back.

These annotations were used by prefast plugin that analyzed contract consistency. This prefast plugin is not coming back.
@Copilot Copilot AI review requested due to automatic review settings May 31, 2025 19:49
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes all SCAN_* and related static analysis annotations from exception handling and contract macros, consolidating contract headers and cleaning up annotation-only code.

  • Deleted SCAN_ markers and ANNOTATION_* usages across multiple VM and utilcode files.
  • Streamlined staticcontract.h by replacing annotation-based contracts with empty macro definitions.
  • Fixed duplicate includes of eecontract.h in common.h.

Reviewed Changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/coreclr/vm/exceptmacros.h Removed SCAN_EHMARKER* and ANNOTATION_NOTHROW macros
src/coreclr/vm/excep.h Deleted SCAN_SCOPE_BEGIN/END around helper constructor
src/coreclr/vm/eecontract.cpp Removed SCAN_IGNORE_* markers from DoChecks
src/coreclr/vm/crst.h Deleted ANNOTATION_SPECIAL_HOLDER_CALLER_NEEDS_DYNAMIC_CONTRACT
src/coreclr/vm/crst.cpp Removed SCAN_IGNORE_* macros in Enter
src/coreclr/vm/common.h Added and de-duplicated #include "eecontract.h"
src/coreclr/vm/clrex.cpp Removed SCAN_IGNORE_FAULT in exception path
src/coreclr/vm/assemblyspec.cpp Deleted SCAN_IGNORE_FAULT in wrappers
src/coreclr/vm/appdomain.hpp Removed ANNOTATION_SPECIAL_HOLDER_CALLER_NEEDS_DYNAMIC_CONTRACT
src/coreclr/utilcode/stacktrace.cpp Cleaned SCAN_IGNORE_FAULT from image/dbghelp loads
src/coreclr/utilcode/pedecoder.cpp Removed ANNOTATION_DEBUG_ONLY
src/coreclr/utilcode/log.cpp Deleted SCAN_IGNORE_FAULT in logging functions
src/coreclr/utilcode/check.cpp Removed SCAN_SCOPE_BEGIN and ANNOTATION_VIOLATION
src/coreclr/inc/staticcontract.h Replaced annotation macros with empty STATIC_CONTRACT_* definitions
src/coreclr/inc/palclr.h Deleted SCAN_EHMARKER* and throw markers in PAL_TRY
src/coreclr/inc/ostype.h Removed static contract annotations from macros
src/coreclr/inc/ex.h Removed SCAN_SCOPE_* and SCAN_EHMARKER in exception helpers
src/coreclr/inc/contract.h Deleted SCAN_SCOPE_BEGIN/END in contract holders
src/coreclr/debug/ee/debugger.h Removed SCAN_SCOPE_BEGIN/END in GC holder
src/coreclr/debug/ee/debugger.cpp Removed SCAN_IGNORE_TRIGGER in debugger notifications

@jkotas
Copy link
Member Author

jkotas commented Jun 8, 2025

/ba-g timeout

@jkotas jkotas merged commit b561607 into dotnet:main Jun 8, 2025
94 of 96 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants