Skip to content

Commit e944ebc

Browse files
authored
Merge pull request #46907 from smuzaffar/ubsan-fix-HepMCProduct
[UBSAN]Fix runtime error for invalid bool value assignment
2 parents d288c81 + adae936 commit e944ebc

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

SimDataFormats/GeneratorProducts/src/HepMCProduct.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ void HepMCProduct::addHepMCData(HepMC::GenEvent* evt) {
3636

3737
void HepMCProduct::applyVtxGen(HepMC::FourVector const& vtxShift) {
3838
//std::cout<< " applyVtxGen called " << isVtxGenApplied_ << endl;
39-
//fTimeOffset = 0;
4039

4140
if (isVtxGenApplied())
4241
return;
@@ -126,16 +125,14 @@ HepMCProduct::HepMCProduct(HepMCProduct const& other) : evt_(nullptr) {
126125
isVtxGenApplied_ = other.isVtxGenApplied_;
127126
isVtxBoostApplied_ = other.isVtxBoostApplied_;
128127
isPBoostApplied_ = other.isPBoostApplied_;
129-
//fTimeOffset = other.fTimeOffset;
130128
}
131129

132130
// swap
133131
void HepMCProduct::swap(HepMCProduct& other) {
134132
std::swap(evt_, other.evt_);
135-
std::swap(isVtxGenApplied_, other.isVtxGenApplied_);
136-
std::swap(isVtxBoostApplied_, other.isVtxBoostApplied_);
137-
std::swap(isPBoostApplied_, other.isPBoostApplied_);
138-
//std::swap(fTimeOffset, other.fTimeOffset);
133+
isVtxGenApplied_ = other.isVtxGenApplied_;
134+
isVtxBoostApplied_ = other.isVtxBoostApplied_;
135+
isPBoostApplied_ = other.isPBoostApplied_;
139136
}
140137

141138
// assignment: use copy/swap idiom for exception safety.

0 commit comments

Comments
 (0)