diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2013-10-02 02:29:49 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2013-10-02 02:29:49 +0000 |
| commit | 4ee7dc2369c1f0257a73b2e83a7d38fdebdd9176 (patch) | |
| tree | 108032a1d8a135f4f643b7d47226fe526a832202 /lib/CodeGen/CGException.cpp | |
| parent | 7453624b98817f06d28ed2abe39c98805cfec623 (diff) | |
| download | clang-4ee7dc2369c1f0257a73b2e83a7d38fdebdd9176.tar.gz clang-4ee7dc2369c1f0257a73b2e83a7d38fdebdd9176.tar.bz2 clang-4ee7dc2369c1f0257a73b2e83a7d38fdebdd9176.tar.xz | |
Thread a SourceLocation into the EmitCheck for "load_invalid_value". This occurs
when scalars are loaded / undergo lvalue-to-rvalue conversion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191808 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGException.cpp')
| -rw-r--r-- | lib/CodeGen/CGException.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp index 1748621da3..39a992aab1 100644 --- a/lib/CodeGen/CGException.cpp +++ b/lib/CodeGen/CGException.cpp @@ -945,7 +945,8 @@ static llvm::Value *CallBeginCatch(CodeGenFunction &CGF, /// parameter during catch initialization. static void InitCatchParam(CodeGenFunction &CGF, const VarDecl &CatchParam, - llvm::Value *ParamAddr) { + llvm::Value *ParamAddr, + SourceLocation Loc) { // Load the exception from where the landing pad saved it. llvm::Value *Exn = CGF.getExceptionFromSlot(); @@ -1052,11 +1053,11 @@ static void InitCatchParam(CodeGenFunction &CGF, CGF.getContext().getDeclAlign(&CatchParam)); switch (TEK) { case TEK_Complex: - CGF.EmitStoreOfComplex(CGF.EmitLoadOfComplex(srcLV), destLV, + CGF.EmitStoreOfComplex(CGF.EmitLoadOfComplex(srcLV, Loc), destLV, /*init*/ true); return; case TEK_Scalar: { - llvm::Value *ExnLoad = CGF.EmitLoadOfScalar(srcLV); + llvm::Value *ExnLoad = CGF.EmitLoadOfScalar(srcLV, Loc); CGF.EmitStoreOfScalar(ExnLoad, destLV, /*init*/ true); return; } @@ -1150,7 +1151,7 @@ static void BeginCatch(CodeGenFunction &CGF, const CXXCatchStmt *S) { // Emit the local. CodeGenFunction::AutoVarEmission var = CGF.EmitAutoVarAlloca(*CatchParam); - InitCatchParam(CGF, *CatchParam, var.getObjectAddress(CGF)); + InitCatchParam(CGF, *CatchParam, var.getObjectAddress(CGF), S->getLocStart()); CGF.EmitAutoVarCleanups(var); } |
