[PATCH 19/22] covoar: Catch exceptional case

Alex White alexanderjwhite at gmail.com
Mon Mar 1 20:01:26 UTC 2021


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

diff --git a/tester/covoar/ExecutableInfo.cc b/tester/covoar/ExecutableInfo.cc
index 187bb77..5a730fd 100644
--- a/tester/covoar/ExecutableInfo.cc
+++ b/tester/covoar/ExecutableInfo.cc
@@ -201,6 +201,16 @@ namespace Coverage {
     CoverageMapBase        *theMap;
     CoverageMaps::iterator  itr;
 
+    if ( lowAddress > highAddress ) {
+      std::ostringstream what;
+      what << "Low address is greater than high address for symbol "
+            << symbolName
+            << " (" << lowAddress
+            << " and " << highAddress
+            << ")";
+      throw rld::error( what, "ExecutableInfo::createCoverageMap" );
+    }
+
     itr = coverageMaps.find( symbolName );
     if ( itr == coverageMaps.end() ) {
       theMap = new CoverageMap( fileName, lowAddress, highAddress );
-- 
2.27.0



More information about the devel mailing list