Skip to content

Commit

Permalink
Fix potential use of dangling temporary.
Browse files Browse the repository at this point in the history
In

```
  const TGeoHMatrix& m = par.nominal().worldTransformation();
```
nominal() returns a temporary Alignment object by value, and
worldTransformation() returns a reference within that Alignment object.
So we shoud make a copy.
  • Loading branch information
sss committed Jan 11, 2025
1 parent c532581 commit 95ed3b2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void Installer<UserData>::install(dd4hep::DetElement component, dd4hep::PlacedVo
}
else if ( !handleUsingCache(component,comp_vol) ) {
dd4hep::DetElement par = component.parent();
const TGeoHMatrix& m = par.nominal().worldTransformation();
const TGeoHMatrix m = par.nominal().worldTransformation();
double dz = m.GetTranslation()[2];
const double* trans = placementTranslation(component);
double half_mod_thickness = (mod_shape->GetZ(1)-mod_shape->GetZ(0))/2.0;
Expand Down

0 comments on commit 95ed3b2

Please sign in to comment.