From 924d1873da666476a23f3a9f988401eb122870f7 Mon Sep 17 00:00:00 2001 From: Vasil Velichkov Date: Tue, 27 Mar 2018 21:08:00 +0300 Subject: Fix an assert in ViterbiR2O4::decode The table length was wrong becuase matchCostTable is a float pointer and not an array since 792330777d7c21df02ce1ecb6f876b076a14b519 python2.7: /home/user/gr-gsm/lib/decoding/openbts/ViterbiR204.cpp:288: virtual void ViterbiR2O4::decode(const SoftVector&, BitVector&): Assertion `match-matchCostTable<(float)sizeof(matchCostTable)/sizeof(matchCostTable[0])-1' failed. (gdb) f 4 #4 0x00007fffdff820c3 in ViterbiR2O4::decode (this=0x5555563bbdf0, in=..., target=...) at /home/vasko/sources/gr-gsm/gr-gsm/lib/decoding/openbts/ViterbiR204.cpp:288 288 assert(match-matchCostTable<(float)sizeof(matchCostTable)/sizeof(matchCostTable[0])-1); (gdb) p match-matchCostTable $1 = 2 (gdb) p (float)sizeof(matchCostTable)/sizeof(matchCostTable[0])-1 $2 = 1 (gdb) p (float)sizeof(matchCostTable)/sizeof(matchCostTable[0]) $3 = 2 (gdb) p sizeof(matchCostTable) $4 = 8 --- lib/decoding/openbts/ViterbiR204.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/decoding/openbts/ViterbiR204.cpp b/lib/decoding/openbts/ViterbiR204.cpp index fe31aad..29a46e8 100644 --- a/lib/decoding/openbts/ViterbiR204.cpp +++ b/lib/decoding/openbts/ViterbiR204.cpp @@ -285,8 +285,8 @@ void ViterbiR2O4::decode(const SoftVector &in, BitVector& target) const ViterbiR2O4::vCand *minCost = NULL; while (op