[Lldb-commits] [lldb] r274787 - Check whether Sema::CreateBuiltinUnaryOp returns an empty result.
Jim Ingham via lldb-commits
lldb-commits at lists.llvm.org
Thu Jul 7 12:06:38 PDT 2016
Author: jingham
Date: Thu Jul 7 14:06:37 2016
New Revision: 274787
URL: http://llvm.org/viewvc/llvm-project?rev=274787&view=rev
Log:
Check whether Sema::CreateBuiltinUnaryOp returns an empty result.
If it does, calling AddInitializerToDecl will crash, so we should
abort the result synthesis in this case.
<rdar://problem/27205383>
Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp?rev=274787&r1=274786&r2=274787&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp Thu Jul 7 14:06:37 2016
@@ -373,6 +373,8 @@ ASTResultSynthesizer::SynthesizeBodyResu
ExprResult address_of_expr = m_sema->CreateBuiltinUnaryOp(SourceLocation(), UO_AddrOf, last_expr);
if (address_of_expr.get())
m_sema->AddInitializerToDecl(result_decl, address_of_expr.get(), true, false);
+ else
+ return false;
}
else
{
More information about the lldb-commits
mailing list