Allow disabling context-sensitivity for specific functions#1995
Draft
Allow disabling context-sensitivity for specific functions#1995
Conversation
…on context-insensitivity Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/5d5147c1-4b56-47f6-b7ef-01b3c007d358 Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add option to disable context-sensitivity for specific functions
Allow disabling context-sensitivity for specific functions
Apr 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Functions called with many different contexts can cause analysis blowup. This adds a way to disable context-sensitivity for specific functions at the MCP level, returning an empty context list
[]for all call sites of the annotated function.Three mechanisms supported
C attribute (no source modification to definition needed):
Config option (no source changes required):
Per-function annotation config:
Changes
src/analyses/mCP.ml:contextfunction now short-circuits to[]when the function has theno-contextattribute or appears inana.context.no_fun, making it context-insensitive across all activated analysessrc/config/options.schema.json: Added"no-context"togoblint_contextattribute enum; addedana.context.no_funstring-list optiondocs/user-guide/annotating.md: Documented newno-contextattribute valuetests/regression/90-context/: Regression tests for all three mechanisms