Skip to content

MuonCondData fix unreachable code in CscCondDbData

Edward Moyse requested to merge emoyse/athena:23.0-fix-coverity_3 into 23.0

This is attempting to fix coverity issue# 13960 "structurally dead code".

I am keeping this as Draft until this can be discussed with CSC experts, because on the face of it, this looks like it might be bad (edit: this sounded a bit dramatic, but bad in that I don't think this code ever worked).

The problem is code like this:

if     (parName == "f001"   ) { float theVal; return readChannelF001   (hash, theVal); val = theVal; }

The final val = theVal is not reached because of the preceding return statement. This matters because theVal is passed in as reference in the enclosing function readChannelParam, and this seems to be important in clients e.g.

    float diff = val - oldVal;

(https://gitlab.cern.ch/atlas/athena/-/blob/master/MuonSpectrometer/MuonValidation/MuonDQA/MuonCalibMonitoring/src/CscCalibMonToolBase.cxx#L821)

I opened a ticket in ATLASRECTS-7670

Edited by Edward Moyse

Merge request reports