[LLVMbugs] [Bug 15881] New: clang fails to detect delete x; return x

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 30 20:27:16 PDT 2013


            Bug ID: 15881
           Summary: clang fails to detect delete x; return x
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: peter at stairways.com.au
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Mac, Xcode 4.6.2, Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM
3.2svn), Objective C++.

Neither clang with lots of warning enabled, nor the static analyser detect this
simple failure case:

AMouseMoveAndClick::Merge( HBaseAction* action )
    AMouseMoveAndClick* newAction = new AMouseMoveAndClick( *this );
    delete newAction;
    return newAction;

Shouldn't pretty much any use of a deleted variable be flagged as an error?

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/20130501/242f2981/attachment.html>

More information about the llvm-bugs mailing list