HomePhabricator

[analyzer] Assume new returns non-null even under -fno-exceptions

Authored by labath on Aug 28 2013, 1:04 AM.

Description

[analyzer] Assume new returns non-null even under -fno-exceptions

Summary:
-fno-exceptions does not implicitly attach a nothrow specifier to every operator
new. Even in this mode, non-nothrow new must not return a null pointer. Failure
to allocate memory can be signalled by other means, or just by killing the
program. This behaviour is consistent with the compiler - even with
-fno-exceptions, the generated code never tests for null (and would segfault if
the opeator actually happened to return null).

Reviewers: jordan_rose

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1528

llvm-svn: 189452

Details

Committed
labathAug 28 2013, 1:04 AM
Parents
rG65b79829c365: clang-format: Improve braced init list detection:
Branches
Unknown
Tags
Unknown