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> llvm-svn: 274787
This commit is contained in:
parent
65fa0704aa
commit
3a45e03442
|
@ -373,6 +373,8 @@ ASTResultSynthesizer::SynthesizeBodyResult (CompoundStmt *Body,
|
|||
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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue