[PATCH] covoar: Fix off-by-one in Coverage::finalizeSymbol()

Alex White alex.white at oarcorp.com
Wed Mar 31 16:04:43 UTC 2021


The `rangeIndex` variable is 1 higher than the index at which the first
instruction address was found. This fixes the lookup after the loop to
account for that fact.
---
 tester/covoar/ObjdumpProcessor.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tester/covoar/ObjdumpProcessor.cc b/tester/covoar/ObjdumpProcessor.cc
index 62a06c5..1cfa877 100644
--- a/tester/covoar/ObjdumpProcessor.cc
+++ b/tester/covoar/ObjdumpProcessor.cc
@@ -60,7 +60,7 @@ namespace Coverage {
         lowAddress = coverageMap.getLowAddressOfRange(rangeIndex);
       }
 
-      uint32_t sizeWithoutNops = coverageMap.getSizeOfRange(rangeIndex);
+      uint32_t sizeWithoutNops = coverageMap.getSizeOfRange(rangeIndex - 1);
       uint32_t size = sizeWithoutNops;
       uint32_t highAddress = lowAddress + size - 1;
       uint32_t computedHighAddress = highAddress;
-- 
2.27.0



More information about the devel mailing list