diff --git a/breakpoint_register.cpp b/breakpoint_register.cpp index d0f893a..20b2cc2 100644 --- a/breakpoint_register.cpp +++ b/breakpoint_register.cpp @@ -79,7 +79,7 @@ std::pair > breakpoint_registe return { nullptr, "register: key or value missing" }; auto values_in = parts.at(1); - auto v_parts = split(values_in, ","); + auto v_parts = split(std::move(values_in), ","); std::set values; for(auto & v: v_parts) values.insert(std::stoi(v, nullptr, 8)); diff --git a/cpu.cpp b/cpu.cpp index 68382ab..5fef699 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -346,6 +346,8 @@ bool cpu::check_pending_interrupts() const for(uint8_t i=start_level; i < 8; i++) { auto interrupts = queued_interrupts.find(i); + assert(interrupts != queued_interrupts.end()); + if (interrupts->second.empty() == false) return true; } @@ -2316,7 +2318,7 @@ std::map > cpu::disassemble(const uint16_t // PSW std::string psw_str = format("%d%d|%d|%d|%c%c%c%c%c", psw >> 14, (psw >> 12) & 3, (psw >> 11) & 1, (psw >> 5) & 7, psw & 16?'t':'-', psw & 8?'n':'-', psw & 4?'z':'-', psw & 2 ? 'v':'-', psw & 1 ? 'c':'-'); - out.insert({ "psw", { psw_str } }); + out.insert({ "psw", { std::move(psw_str) } }); out.insert({ "psw-value", { format("%06o", psw) } }); // values worked with diff --git a/disk_backend_nbd.cpp b/disk_backend_nbd.cpp index 3067bc7..7e3c7fd 100644 --- a/disk_backend_nbd.cpp +++ b/disk_backend_nbd.cpp @@ -119,13 +119,14 @@ bool disk_backend_nbd::connect(const bool retry) } } - if (memcmp(nbd_hello.magic1, "NBDMAGIC", 8) != 0) { + if (fd != -1 && memcmp(nbd_hello.magic1, "NBDMAGIC", 8) != 0) { close(fd); fd = -1; DOLOG(warning, true, "disk_backend_nbd::connect: magic invalid"); } - DOLOG(info, false, "NBD size: %u", NTOHLL(nbd_hello.size)); + if (fd != -1) + DOLOG(info, false, "NBD size: %u", NTOHLL(nbd_hello.size)); } while(fd == -1 && retry);