diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-08-28 16:48:44 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-08-28 16:48:44 +0000 |
commit | 33375375a4c31cf31803c6f9555ca023864818fe (patch) | |
tree | f8e4e3072f6693adc5dce78cf2a499134ecb2bd8 /clang/lib/CodeGen/CGCXXABI.h | |
parent | 50cbfc513827b192b77f3c2ee5ea70fcda36433e (diff) | |
download | bcm5719-llvm-33375375a4c31cf31803c6f9555ca023864818fe.tar.gz bcm5719-llvm-33375375a4c31cf31803c6f9555ca023864818fe.zip |
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.
llvm-svn: 216675
Diffstat (limited to 'clang/lib/CodeGen/CGCXXABI.h')
-rw-r--r-- | clang/lib/CodeGen/CGCXXABI.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCXXABI.h b/clang/lib/CodeGen/CGCXXABI.h index 39813fd475d..af5fb19f256 100644 --- a/clang/lib/CodeGen/CGCXXABI.h +++ b/clang/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, |