Skip to content

Lower the minimum number of affected pointers for -warn-root-cause from 2 to 1 #685

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

Closed
mattmccutchen-cci opened this issue Aug 19, 2021 · 0 comments · Fixed by #721
Closed

Comments

@mattmccutchen-cci
Copy link
Member

Currently, 3c -warn-root-cause shows a root cause only if its location is in one of the main source files or it affects at least 2 relevant pointers:

if (WarnAllRootCause || SM.isInMainFile(SL) || PtrCount > 1) {

This is unhelpful for the tutorial, in which after the first 3C pass, only one wild pointer is left and the user has no good way to find it because its root cause has only 1 affected pointer. In -warn-all-root-cause, the important root cause is buried in a pile of other root causes for unwritable code with 0 affected relevant pointers.

We should probably change -warn-root-cause to show all root causes that affect at least 1 relevant pointer. It looks like the original decision to set the threshold at 2 was made here; that may have made sense at the time (possibly because 3C handled unwritable code differently at the time?), but I don't see any justification for it now.

john-h-kastner added a commit that referenced this issue Oct 4, 2021
This is a change from the previous minimum of two affected pointers.
Fixes #685.
john-h-kastner added a commit that referenced this issue Oct 4, 2021
This is a change from the previous minimum of two affected pointers.
Fixes #685.
john-h-kastner added a commit that referenced this issue Oct 19, 2021
#721)

Root causes will now be emitted if they affect at least one pointer.
This is a change from the previous minimum of two affected pointers.
Fixes #685.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant