Fix regression from r184810.

Specifically, CallExpr::getCalleeDecl() can return null, so make sure to
handle that correctly.

llvm-svn: 184813
This commit is contained in:
Eli Friedman
2013-06-25 01:55:41 +00:00
parent d3f3e4f04c
commit 5a8738ffe0
2 changed files with 7 additions and 1 deletions

View File

@@ -895,8 +895,10 @@ CanThrowResult Sema::canThrow(const Expr *E) {
CT = CT_Dependent;
else if (isa<CXXPseudoDestructorExpr>(CE->getCallee()->IgnoreParens()))
CT = CT_Cannot;
else
else if (CE->getCalleeDecl())
CT = canCalleeThrow(*this, E, CE->getCalleeDecl());
else
CT = CT_Can;
if (CT == CT_Can)
return CT;
return mergeCanThrow(CT, canSubExprsThrow(*this, E));

View File

@@ -39,6 +39,9 @@ void (*pallspec)() throw(...);
void (*pintspec)() throw(int);
void (*pemptyspec)() throw();
typedef void (*funcptr)();
funcptr returnsptr() throw();
void callptr() {
N(pnospec());
N((*pnospec)());
@@ -48,6 +51,7 @@ void callptr() {
N((*pintspec)());
P(pemptyspec());
P((*pemptyspec)());
N(returnsptr()());
}
struct S1 {