Skip to content

Add CaloIndex::Undefined enum value

Addresses a number of undefined behaviour sanitizer errors, e.g.

/cvmfs/ runtime error: load of value 4294967295, which is not a valid value for type 'CaloIndex'

These are caused by the fact in a number of places, -1 was statically cast to enum CaloCellCode::CaloIndex and the sanitizer (correctly) flags this as undefined behaviour due to the fact -1 did not correspond to a defined value for the enum.

Solution is simple. Acknowledge that a undefined state for the enum is required, and add one.

Edited by Christopher Rob Jones

Merge request reports