Skip to content

Commit

Permalink
Fix use of object after destructor in HcalHardcodeCalibrations
Browse files Browse the repository at this point in the history
The temporarily created ESConsumesCollector is held by reference
but goes away on that line (since the compiler does not know it
must extend the lifetime of the object returned by setWhatProduced).
The problem was found by the address sanitizer.
  • Loading branch information
Dr15Jones committed Nov 17, 2019
1 parent 4d09d3c commit 930d5a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc
Expand Up @@ -239,7 +239,8 @@ HcalHardcodeCalibrations::HcalHardcodeCalibrations(const edm::ParameterSet& iCon
findingRecord<HcalZSThresholdsRcd>();
}
if ((objectName == "RespCorrs") || (objectName == "ResponseCorrection") || all) {
auto& c = setWhatProduced(this, &HcalHardcodeCalibrations::produceRespCorrs).setConsumes(topoTokens_[kRespCorrs]);
auto c = setWhatProduced(this, &HcalHardcodeCalibrations::produceRespCorrs);
c.setConsumes(topoTokens_[kRespCorrs]);
if (he_recalibration) {
c.setConsumes(heDarkeningToken_, edm::ESInputTag("", "HE"));
}
Expand Down

0 comments on commit 930d5a8

Please sign in to comment.