[PATCH 2/4] CoverageMapBase.cc: Restore ostream format

Ryan Long ryan.long at oarcorp.com
Mon Jul 19 17:13:31 UTC 2021


CID 1503022: Not restoring ostream format

Save format of stream before changing it, and change it back before returning.

Closes #4470
---
 tester/covoar/CoverageMapBase.cc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tester/covoar/CoverageMapBase.cc b/tester/covoar/CoverageMapBase.cc
index f0b5890..8845aab 100644
--- a/tester/covoar/CoverageMapBase.cc
+++ b/tester/covoar/CoverageMapBase.cc
@@ -75,6 +75,9 @@ namespace Coverage {
 
   void AddressRange::dump (std::ostream& out, bool show_slots) const
   {
+    std::ofstream oldState;
+    oldState.copyfmt( out );
+
     out << std::hex << std::setfill('0')
         << "Address range: low = " << std::setw(8) << lowAddress
         << " high = " << std::setw(8) << highAddress
@@ -99,6 +102,8 @@ namespace Coverage {
             << std::endl;
       }
     }
+
+    out.copyfmt( oldState );
   }
 
   CoverageMapBase::CoverageMapBase(
-- 
1.8.3.1



More information about the devel mailing list