summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/CGCXXABI.h
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-08-28 16:48:44 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-08-28 16:48:44 +0000
commit1c990380ce6984649f98d6bfea7543fa9e24f37b (patch)
treeb346fdbf7fec6f789a6c05dfc4babb32ac682a4f /lib/CodeGen/CGCXXABI.h
parentd2cac94bf572b95c17b57916dd540beb95c092d7 (diff)
Throw a std::bad_array_new_length exception when the expression (or constant-expression) passed to operator new[] results in overflow in conformance with [expr.new]p7. Fixes PR11644.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216675 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXXABI.h')
-rw-r--r--lib/CodeGen/CGCXXABI.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCXXABI.h b/lib/CodeGen/CGCXXABI.h
index 39813fd475..af5fb19f25 100644
--- a/lib/CodeGen/CGCXXABI.h
+++ b/lib/CodeGen/CGCXXABI.h
@@ -236,6 +236,13 @@ public:
virtual bool EmitBadCastCall(CodeGenFunction &CGF) = 0;
+ /// Emit the code required to throw a std::bad_array_new_length exception by
+ /// the ABI, and returns the array length size to allocate.
+ virtual llvm::Value *
+ EmitNewArrayLengthOverflowCheck(CodeGenFunction &CGF, bool ConstantOverflow,
+ llvm::Value *DynamicOverflow,
+ llvm::Value *Size);
+
virtual llvm::Value *GetVirtualBaseClassOffset(CodeGenFunction &CGF,
llvm::Value *This,
const CXXRecordDecl *ClassDecl,