[rtems-tools commit] covoar: Fix overflow of high PC address

Joel Sherrill joel at rtems.org
Tue Mar 30 18:20:47 UTC 2021


Module:    rtems-tools
Branch:    master
Commit:    917469b2d3bdcf9186b1cbeccdd85361a1ce5d4e
Changeset: http://git.rtems.org/rtems-tools/commit/?id=917469b2d3bdcf9186b1cbeccdd85361a1ce5d4e

Author:    Alex White <alex.white at oarcorp.com>
Date:      Fri Feb 26 17:11:06 2021 -0600

covoar: Fix overflow of high PC address

This fixes an integer overflow that would occur if a function's high PC
address were zero in the DWARF info.

---

 tester/covoar/ExecutableInfo.cc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tester/covoar/ExecutableInfo.cc b/tester/covoar/ExecutableInfo.cc
index b75d0b5..fc368ce 100644
--- a/tester/covoar/ExecutableInfo.cc
+++ b/tester/covoar/ExecutableInfo.cc
@@ -71,6 +71,11 @@ namespace Coverage {
             }
           }
 
+          // We can't process a zero size function.
+          if (func.pc_high() == 0) {
+            continue;
+          }
+
           createCoverageMap (cu.name(), func.name(),
                               func.pc_low(), func.pc_high() - 1);
         }



More information about the vc mailing list