* We need 0-terminated string (Thanks Axel for pointing that out) indeed.

* Add comment explaining it.
* Improve style of implementation.


git-svn-id: http://root.cern.ch/svn/root/trunk@46664 27541ba8-7e3a-0410-8455-c3a389f83636
This commit is contained in:
Vassil Vassilev 2012-10-19 07:33:44 +00:00
parent 9327a62ee1
commit a209569ac5

View File

@ -480,10 +480,12 @@ namespace cling {
std::string mangledNameIfNeeded;
Sema& S = getCI()->getSema();
FunctionDecl* FD
= cast_or_null<FunctionDecl>(utils::Lookup::Named(&S, fname.data()));
// We need 0-terminated string.
NamedDecl *ND = utils::Lookup::Named(&S, fname.str().c_str());
if (!ND)
return false;
if (FD) {
if (FunctionDecl* FD = dyn_cast<FunctionDecl>(ND)) {
mangleName(FD, mangledNameIfNeeded);
m_ExecutionContext->executeFunction(mangledNameIfNeeded.c_str(),
getCI()->getASTContext(),