Skip to content

Commit

Permalink
TEnum::GetEnum normalize name before search.
Browse files Browse the repository at this point in the history
This allows to resolved using statement and find the target enum.

This fixes root-project#15406
  • Loading branch information
pcanal committed May 2, 2024
1 parent ea88235 commit fe07866
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions core/meta/src/TEnum.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,21 @@ TEnum *TEnum::GetEnum(const char *enumName, ESearchAction sa)
return nullptr;
}

// Keep the state consistent. I particular prevent change in the state of AutoLoading and AutoParsing allowance
// and gROOT->GetListOfClasses() and the later update/modification to the autoparsing state.
// Keep the state consistent. In particular prevent change in the state of
// AutoLoading and AutoParsing allowance and gROOT->GetListOfClasses()
// and the later update/modification to the autoparsing state.
R__READ_LOCKGUARD(ROOT::gCoreMutex);

std::string normalizedName;
{
TInterpreter::SuspendAutoLoadingRAII autoloadOff(gInterpreter);
TClassEdit::GetNormalizedName(normalizedName, enumName);
}
if (normalizedName != enumName) {
enumName = normalizedName.c_str();
lastPos = TClassEdit::GetUnqualifiedName(enumName);
}

if (lastPos != enumName) {
// We have a scope
// All of this C gymnastic is to avoid allocations on the heap (see TClingLookupHelper__ExistingTypeCheck)
Expand Down

0 comments on commit fe07866

Please sign in to comment.