http://llvm.org/bugs/show_bug.cgi?id=15032
Bug #: 15032 Summary: False positive: Dereference of null pointer Product: clang Version: trunk Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P Component: Static Analyzer AssignedTo: kreme...@apple.com ReportedBy: o...@wanadoo.es CC: llvmbugs@cs.uiuc.edu Classification: Unclassified The code below triggers this warning with clang -r171239 (built with g++ 4.7.2 on Kubuntu x86_64): $ clang++ --analyze -c csa.cpp csa.cpp:13:26: warning: Dereference of null pointer items[cursor].refCount += 1; ~~~~~~~~~~~~~~~~~~~~~~~^~~~ #include <vector> struct Item { Item() : refCount(0) {} int refCount; }; std::vector<Item> items; void foo() { items.push_back(Item()); std::size_t cursor = items.size() - 1; items[cursor].refCount += 1; } -- Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ LLVMbugs mailing list LLVMbugs@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs