Disassembler: restore ostream state after changing it

Found by Coverity Scan, CID 25679.

Change-Id: Ia0c175cd79ddc42ab9154c667db0d647618e41e2
This commit is contained in:
Horst Schirmeier
2015-02-07 15:07:34 +01:00
parent 141cefbaf4
commit 0e305034e9

View File

@ -55,7 +55,9 @@ int Disassembler::init(const char* path) {
std::ostream& operator <<(std::ostream & os, const fail::Instruction & i) {
#ifndef __puma
std::ios::fmtflags f(os.flags()); // save ostream state
os << std::hex << ((int)(i.address)) << "\t" << i.opcode << "\t" << i.instruction << "\t" << i.comment;
os.flags(f); // restore ostream state
#endif
return os;
}