From adae936c14ba451b2843b41f9615da4255975b94 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Tue, 10 Dec 2024 13:44:47 +0100 Subject: [PATCH] [UBSAN]Fix runtime error for invalid bool value assignment --- SimDataFormats/GeneratorProducts/src/HepMCProduct.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/SimDataFormats/GeneratorProducts/src/HepMCProduct.cc b/SimDataFormats/GeneratorProducts/src/HepMCProduct.cc index 6a37507b265e0..2de4e471aeb86 100644 --- a/SimDataFormats/GeneratorProducts/src/HepMCProduct.cc +++ b/SimDataFormats/GeneratorProducts/src/HepMCProduct.cc @@ -36,7 +36,6 @@ void HepMCProduct::addHepMCData(HepMC::GenEvent* evt) { void HepMCProduct::applyVtxGen(HepMC::FourVector const& vtxShift) { //std::cout<< " applyVtxGen called " << isVtxGenApplied_ << endl; - //fTimeOffset = 0; if (isVtxGenApplied()) return; @@ -126,16 +125,14 @@ HepMCProduct::HepMCProduct(HepMCProduct const& other) : evt_(nullptr) { isVtxGenApplied_ = other.isVtxGenApplied_; isVtxBoostApplied_ = other.isVtxBoostApplied_; isPBoostApplied_ = other.isPBoostApplied_; - //fTimeOffset = other.fTimeOffset; } // swap void HepMCProduct::swap(HepMCProduct& other) { std::swap(evt_, other.evt_); - std::swap(isVtxGenApplied_, other.isVtxGenApplied_); - std::swap(isVtxBoostApplied_, other.isVtxBoostApplied_); - std::swap(isPBoostApplied_, other.isPBoostApplied_); - //std::swap(fTimeOffset, other.fTimeOffset); + isVtxGenApplied_ = other.isVtxGenApplied_; + isVtxBoostApplied_ = other.isVtxBoostApplied_; + isPBoostApplied_ = other.isPBoostApplied_; } // assignment: use copy/swap idiom for exception safety.