[LLVMbugs] [Bug 20651] New: ::operator new(size_t) should assert in -fno-exceptions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 13 12:07:25 PDT 2014


            Bug ID: 20651
           Summary: ::operator new(size_t) should assert in
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvm-bugs at quasiparticle.net
                CC: llvmbugs at cs.uiuc.edu, mclow.lists at gmail.com
    Classification: Unclassified

Currently, the global operator new(size_t), when libc++ is compiled without
exceptions, will return nullptr on allocation failure. Since ::operator
new(size_t) must return a valid piece of memory, this leads to crashes on
allocation failures.

Instead of returning null, ::operator new(size_t) should probably assert on
builds without exceptions to avoid this, since nothrow new already has
nullptr-on-failure semantics.

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/20140813/dc403790/attachment.html>

More information about the llvm-bugs mailing list