Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug where we could return a const & to a temporary from ParameterSet::getUntrackedParameterSet* #615

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions FWCore/ParameterSet/interface/ParameterSet.h
Expand Up @@ -107,10 +107,10 @@ namespace edm {
ParameterSet const&
getParameterSet(char const*) const;

ParameterSet const&
ParameterSet
getUntrackedParameterSet(std::string const& name, ParameterSet const& defaultValue) const;

ParameterSet const&
ParameterSet
getUntrackedParameterSet(char const* name, ParameterSet const& defaultValue) const;

ParameterSet const&
Expand All @@ -125,10 +125,10 @@ namespace edm {
VParameterSet const&
getParameterSetVector(char const* name) const;

VParameterSet const&
VParameterSet
getUntrackedParameterSetVector(std::string const& name, VParameterSet const& defaultValue) const;

VParameterSet const&
VParameterSet
getUntrackedParameterSetVector(char const* name, VParameterSet const& defaultValue) const;

VParameterSet const&
Expand Down
8 changes: 4 additions & 4 deletions FWCore/ParameterSet/src/ParameterSet.cc
Expand Up @@ -2363,12 +2363,12 @@ namespace edm {
return retrieveParameterSet(name).pset();
}

ParameterSet const&
ParameterSet
ParameterSet::getUntrackedParameterSet(std::string const& name, ParameterSet const& defaultValue) const {
return getUntrackedParameterSet(name.c_str(), defaultValue);
}

ParameterSet const&
ParameterSet
ParameterSet::getUntrackedParameterSet(char const* name, ParameterSet const& defaultValue) const {
ParameterSetEntry const* entryPtr = retrieveUntrackedParameterSet(name);
if(entryPtr == 0) {
Expand Down Expand Up @@ -2401,12 +2401,12 @@ namespace edm {
return retrieveVParameterSet(name).vpset();
}

VParameterSet const&
VParameterSet
ParameterSet::getUntrackedParameterSetVector(std::string const& name, VParameterSet const& defaultValue) const {
return getUntrackedParameterSetVector(name.c_str(), defaultValue);
}

VParameterSet const&
VParameterSet
ParameterSet::getUntrackedParameterSetVector(char const* name, VParameterSet const& defaultValue) const {
VParameterSetEntry const* entryPtr = retrieveUntrackedVParameterSet(name);
return entryPtr == 0 ? defaultValue : entryPtr->vpset();
Expand Down