Skip to content

Commit d205994

Browse files
shahor02chiarazampolli
authored andcommitted
Fix return value for rANS packing bug recovery
(cherry picked from commit a3c394d)
1 parent e3a7192 commit d205994

File tree

1 file changed

+4
-2
lines changed
  • DataFormats/Detectors/Common/include/DetectorsCommonDataFormats

1 file changed

+4
-2
lines changed

DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/EncodedBlocks.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,10 +1063,12 @@ CTFIOSize EncodedBlocks<H, N, W>::decodeUnpackImpl(dst_IT dest, int slot) const
10631063
const auto* srcIt = block.getData();
10641064
// we have a vector of one and the same value. All information is in the metadata
10651065
if (packingWidth == 0) {
1066-
const dest_t value = [&]() {
1066+
const dest_t value = [&]() -> dest_t {
10671067
// Bugfix: We tried packing values with a width of 0 Bits;
10681068
if (md.nDataWords > 0) {
1069-
return static_cast<dest_t>(*srcIt);
1069+
LOGP(debug, "packing bug recovery: MD nStreams:{} messageLength:{} nLiterals:{} messageWordSize:{} coderType:{} streamSize:{} probabilityBits:{} (int)opt:{} min:{} max:{} literalsPackingOffset:{} literalsPackingWidth:{} nDictWords:{} nDataWords:{} nLiteralWords:{}",
1070+
value, md.nStreams, md.messageLength, md.nLiterals, md.messageWordSize, md.coderType, md.streamSize, md.probabilityBits, (int)md.opt, md.min, md.max, md.literalsPackingOffset, md.literalsPackingWidth, md.nDictWords, md.nDataWords, md.nLiteralWords);
1071+
return offset + static_cast<dest_t>(*srcIt);
10701072
}
10711073
// normal case:
10721074
return offset;

0 commit comments

Comments
 (0)