libclang: fix two memory leaks (PR26292)

llvm-svn: 265994
This commit is contained in:
Hans Wennborg 2016-04-11 20:53:59 +00:00
parent 4d5535a70a
commit 6917b4ac5a
1 changed files with 3 additions and 2 deletions

View File

@ -3571,12 +3571,13 @@ static const ExprEvalResult* evaluateExpr(Expr *expr, CXCursor C) {
rettype = callExpr->getCallReturnType(ctx);
if (rettype->isVectorType() || callExpr->getNumArgs() > 1) {
clang_EvalResult_dispose((CXEvalResult *)result);
return nullptr;
}
if (rettype->isIntegralType(ctx) || rettype->isRealFloatingType()) {
if(callExpr->getNumArgs() == 1 &&
!callExpr->getArg(0)->getType()->isIntegralType(ctx)){
!callExpr->getArg(0)->getType()->isIntegralType(ctx)) {
clang_EvalResult_dispose((CXEvalResult *)result);
return nullptr;
}
} else if(rettype.getAsString() == "CFStringRef") {