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
Validation/RecoMuon HTrack: make a copy instead of a reference to a temporary #34183
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-34183/23394
|
A new Pull Request was created by @slava77 (Slava Krutelyov) for master. It involves the following packages: Validation/RecoMuon @andrius-k, @kmaeshima, @ErnestaP, @ahmad3213, @cmsbuild, @jfernan2, @rvenditti can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-7cb5a9/16106/summary.html The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:
You can see more details here: Comparison SummarySummary:
|
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
in
M const& errors = fts.cartesianError().matrix();
thecartesianError()
returns a temporary by value, while.matrix()
returns a reference to it.For a general return function the underlying temporary would/could be deleted after the expression is executed and the behavior of the result is undefined.
It seems like due to
.matrix()
being inlined we are getting an extension to the lifetime of the temporary.This update is to explicitly avoid the undefined behavior.