[LLVMbugs] [Bug 18209] New: Interprocedural analysis false positive: throwing exception ignored

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 11 00:46:37 PST 2013


            Bug ID: 18209
           Summary: Interprocedural analysis false positive: throwing
                    exception ignored
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: timac at timac.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11702
  --> http://llvm.org/bugs/attachment.cgi?id=11702&action=edit
Xcode 5 project

Summary: The Static Analyzer fails to detect exception thrown in a function and
generates false positives.

Steps to reproduce:

1- Download the attached Xcode 5 project 'ThrowExceptionStaticAnalyzer' and
open it in Xcode 5.
2- Run the 'Analyze' command

Result: You get a false positive warning "warning: Called C++ object pointer is

More info:

- In a separate .cpp file you have a static function that always throws an
void MyException::Throw() { throw "My Exception"; }

- In your main.cpp file you have the following lines:
void *myPointer = NULL;
if(myPointer == NULL) MyException::Throw();

The interprocedural analyzer fails to detect that MyException::Throw() always
throws an exception.

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/20131211/46f2d0ac/attachment.html>

More information about the llvm-bugs mailing list