https://llvm.org/bugs/show_bug.cgi?id=25226
Bug ID: 25226
Summary: alpha.security.ReturnPtrRange false positives on
iterator end() and rbegin()
Product: clang
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Static Analyzer
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
This check produces a false positive on every `end()` member and non-member
function since the whole point of `end()` is to return an iterator to 1 past
the end. rbegin returns an iterator to one before begin, so this will also
probably fail.
The check maybe be modified to warn on:
- returning a pointer that points to 2 past the end, -2 past the beginning or
more since these cases are a mistake (this is obviously a mistake)
- warn only if this pointer is dereferenced somewhere
If the check cannot be modified to warn on these things maybe its existence
should be reconsidered, since the amount of false positives is just too high on
any codebase that uses iterators.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs