With the change, one can choose not to report comparison (or subtraction)
of a pointer with nullptr pointer.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Is !nullptr expected to be special cased forever or it's transitional?
lib/asan/asan_flags.inc | ||
---|---|---|
139–141 | Can we change it to match detect_odr_violation style? int, detect_invalid_pointer_pairs, 0, "If >= 2, detect operations like <, <=, >, >= and - on invalid pointer " "pairs (e.g. when pointers belong to different objects); " "If == 1, detect invalid operations only when both pointers are non-null.") | |
lib/asan/asan_report.cc | ||
356 | switch (flags()->detect_invalid_pointer_pairs) { case 0 : return; case 1 : if (p1 == nullptr || p2 == nullptr) return; break; } |
Comment Actions
Update version where I addressed comments.
The tristate is not a transition, but it's design to have more fine control of the ASAN check.
lib/asan/asan_report.cc | ||
---|---|---|
346–352 | Well, now you don't need this check. Also, move a1 and a2 declarations past switch statement. |
lib/asan/asan_report.cc | ||
---|---|---|
346 | Again, you do not need this check anymore, it's a part of switch statement now. |
Comment Actions
Comments fixed, please install it if you're fine with that.
lib/asan/asan_report.cc | ||
---|---|---|
346 | No, sorry for overlooking that. |
Can we change it to match detect_odr_violation style?