Only do DynLookup in functions with a body!

This commit is contained in:
Axel Naumann 2016-09-02 08:29:05 +02:00 committed by sftnight
parent 0327bdabe1
commit e71a2c60e1

View File

@ -121,7 +121,8 @@ namespace {
m_EvalTSynth(evalTSynth) {}
bool VisitFunctionDecl(FunctionDecl* FD) {
cling::ASTNodeInfo Replacement = m_EvalTSynth.Visit(FD->getBody());
if (Stmt* Body = FD->getBody()) {
cling::ASTNodeInfo Replacement = m_EvalTSynth.Visit(Body);
if (Replacement.hasErrorOccurred()) {
FD->setBody(nullptr);
return true;
@ -132,6 +133,7 @@ namespace {
FD->setBody(Replacement.getAsSingleNode());
return true;
}
}
return false;
}