[llvm-bugs] [Bug 25773] New: Analyzer misses potential pointer invalidations due to reallocation

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Dec 8 06:40:13 PST 2015


https://llvm.org/bugs/show_bug.cgi?id=25773

            Bug ID: 25773
           Summary: Analyzer misses potential pointer invalidations due to
                    reallocation
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: t at sharklasers.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15414
  --> https://llvm.org/bugs/attachment.cgi?id=15414&action=edit
Code demonstrating the bug

The example hinges on the fact that pointers to objects that a managed by a
container or smart pointer can be invalidated by operations on the container or
smart pointer.

$ scan-build g++ -std=c++1z potential_ptr_invalidation.cpp 
scan-build: Using 'local/tmp/clang/bin/clang' for static analysis
scan-build: Removing directory '/tmp/scan-build-2015-12-08-153923-8231-1'
because it contains no reports.
scan-build: No bugs found.

Example taken from the talk "CppCon 2015: Herb Sutter "Writing Good C++14... By
Default" at 49:54 (a Microsoft static analysis tool was demonstrated that is
supposedly able to catch this bug)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20151208/e3071209/attachment.html>


More information about the llvm-bugs mailing list