There might be returns without return values.

This commit is contained in:
Vassil Vassilev 2014-04-03 13:51:32 +02:00 committed by sftnight
parent 1c237c2844
commit 529088b816

View File

@ -151,8 +151,11 @@ namespace cling {
// if we had return stmt update to execute the SVR init, even if the
// wrapper returns void.
if (RS) {
if (ImplicitCastExpr* VoidCast
= dyn_cast<ImplicitCastExpr>(RS->getRetValue()))
Expr* retValue = RS->getRetValue();
if (!retValue)
RS->setRetValue(SVRInit);
else if (ImplicitCastExpr* VoidCast
= dyn_cast<ImplicitCastExpr>(retValue))
VoidCast->setSubExpr(SVRInit);
}
else