[cfe-dev] Small fix on ExplodedGraph.cpp for review
Argiris Kirtzidis
akyrtzi at gmail.com
Sun Apr 20 13:58:38 PDT 2008
Hi,
The attached patch contains:
- else
- return const_cast<ExplodedNodeImpl**>(&*(getVector(getPtr()).end()));
+ else {
+ // Dereferencing end() is undefined behaviour. The vector is not
empty, so
+ // we can dereference the last elem (end()-1) and then add 1 to the
result.
+ return
const_cast<ExplodedNodeImpl**>(&*(getVector(getPtr()).end()-1)) + 1;
+ }
MSVC's STL checks invalid dereferences (like on end()) and throws
assertion error.
-Argiris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ExplodedGraph-fix.patch
Type: text/x-diff
Size: 673 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080420/453d2ad2/attachment.patch>
More information about the cfe-dev
mailing list