diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-04-09 01:14:18 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-04-09 01:14:18 -0700 |
commit | 90e6596f40c90e0550c1609ffb87d5cedbfe11b8 (patch) | |
tree | 04268cce468a709f5a00dfe3185ba9a722177005 | |
parent | d260b01748a29d15a5f1d498934aa286a017db97 (diff) | |
download | mu-90e6596f40c90e0550c1609ffb87d5cedbfe11b8.tar.gz |
6201
Fix CI. Amazing how misleading the ofstream API is when coercing to bool.
-rw-r--r-- | 003trace.cc | 6 | ||||
-rw-r--r-- | 010---vm.cc | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/003trace.cc b/003trace.cc index c7fc2fe4..08f58546 100644 --- a/003trace.cc +++ b/003trace.cc @@ -185,7 +185,7 @@ void trace_stream::newline() { string curr_contents = curr_stream->str(); if (!curr_contents.empty()) { past_lines.push_back(trace_line(curr_contents, trim(curr_label), curr_depth)); // preserve indent in contents - // maybe incrementally dump trace + // maybe print this line to stderr trace_line& t = past_lines.back(); if (should_incrementally_print_trace()) { dump_trace_line(cerr, t); @@ -454,7 +454,7 @@ else if (is_equal(*arg, "--trace")) { // End --trace Settings } :(before "End trace Commit") -if (Trace_file) { +if (Trace_file.is_open()) { dump_trace_line(Trace_file, t); past_lines.pop_back(); // economize on memory } @@ -462,7 +462,7 @@ if (Trace_file) { atexit(cleanup_main); :(code) void cleanup_main() { - if (Trace_file) Trace_file.close(); + if (Trace_file.is_open()) Trace_file.close(); // End cleanup_main } diff --git a/010---vm.cc b/010---vm.cc index 472990a0..877f4655 100644 --- a/010---vm.cc +++ b/010---vm.cc @@ -187,7 +187,7 @@ inline uint8_t* mem_addr_u8(uint32_t addr) { } } if (result == NULL) { - if (Trace_file) Trace_file.flush(); + if (Trace_file.is_open()) Trace_file.flush(); raise << "Tried to access uninitialized memory at address 0x" << HEXWORD << addr << '\n' << end(); exit(1); } @@ -206,7 +206,7 @@ inline uint32_t* mem_addr_u32(uint32_t addr) { } } if (result == NULL) { - if (Trace_file) Trace_file.flush(); + if (Trace_file.is_open()) Trace_file.flush(); raise << "Tried to access uninitialized memory at address 0x" << HEXWORD << addr << '\n' << end(); raise << "The entire 4-byte word should be initialized and lie in a single segment.\n" << end(); exit(1); @@ -264,7 +264,7 @@ inline bool already_allocated(uint32_t addr) { void run_one_instruction() { uint8_t op=0, op2=0, op3=0; // Run One Instruction - if (Trace_file) { + if (Trace_file.is_open()) { dump_registers(); // End Dump Info for Instruction } |