-
Notifications
You must be signed in to change notification settings - Fork 19
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
Improve wording of uninitialized read warning #321
base: master
Are you sure you want to change the base?
Conversation
Check-perf-impact results: (000e2892abb21ddd1ae413a5c86d7d95) ❓ No new benchmark data submitted. ❓ |
58591aa
to
442b951
Compare
Pull Request Test Coverage Report for Build 12411400550Details
💛 - Coveralls |
bool is_pure_consumer_access = true; | ||
for(size_t i = 0; i < access_map.get_num_accesses(); ++i) { | ||
const auto [b, mode] = access_map.get_nth_access(i); | ||
if(b == bid && is_producer_mode(mode)) { | ||
is_pure_consumer_access = false; | ||
break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also just a heuristic btw; there could be an uninitialized read
and an initialized write
on the same buffer and it would print the no_init
advice. Unfortunately I don't think this can be avoided unless we do the check on a per-accessor basis (which would mean separately evaluating each range mapper, followed by a region map query).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still better than what we have now! ... and we should at some point improve the buffer_access_map
interface so this can just be a std::any_of
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new wording makes it more readable. Nice
The previous warning suggested to use
no_init
even for pure-consumer (read_only
) accesses, which never made any sense.