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

analyze: static/dynamic comparison mode for NON_NULL #1151

Merged
merged 5 commits into from
Nov 20, 2024

Conversation

spernsteiner
Copy link
Collaborator

This adds a mode for comparing static analysis results to the dynamic results from the PDG. Comparison mode is enabled by setting the env var C2RUST_ANALYZE_COMPARE_PDG=1. When this mode is enabled, c2rust-analyze skips normal rewriting and instead prints a copy of the input code with annotation comments indicating places where static and dynamic NON_NULL results disagree. Specifically, it annotates cases where either the static analysis computed NON_NULL but the PDG includes at least one observation where the pointer is null, or the dynamic analysis marked the pointer nullable but the PDG contains observations that are all non-null.

In support of the main change, this branch also includes a refactor of the PDG processing code.

@ahomescu
Copy link
Contributor

ahomescu commented Nov 9, 2024

I have my own changes for the PDG at #1158 and https://github.com/immunant/c2rust/tree/ahomescu/analyze-compare-static-dynamic-v2, we should probably de-duplicate our branches. Could you take a look at mine?

@ahomescu
Copy link
Contributor

ahomescu commented Nov 9, 2024

I have my own changes for the PDG at #1158 and https://github.com/immunant/c2rust/tree/ahomescu/analyze-compare-static-dynamic-v2, we should probably de-duplicate our branches. Could you take a look at mine?

After doing some rebasing, I see that your branch is the same as mine. Closing the latter.

@spernsteiner spernsteiner merged commit 5c27c04 into master Nov 20, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants