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 resolve using statement and find the target enum.

This fixes root-project#15406
  • Loading branch information
pcanal committed May 7, 2024
1 parent f6f37d0 commit 5fe5a82
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions core/meta/src/TEnum.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +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.
std::string normalizedName;
{
R__WRITE_LOCKGUARD(ROOT::gCoreMutex);
TInterpreter::SuspendAutoLoadingRAII autoloadOff(gInterpreter);
TClassEdit::GetNormalizedName(normalizedName, enumName);
}

if (normalizedName != enumName) {
enumName = normalizedName.c_str();
lastPos = TClassEdit::GetUnqualifiedName(enumName);
}

// 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);

if (lastPos != enumName) {
Expand Down

0 comments on commit 5fe5a82

Please sign in to comment.