Initialize bytesDisassembled in opDisassembleResult
MODIFY
src/assembler/assemblerbase.h
src/assembler/assemblerbase.h
@@ -15,7 +15,7 @@ struct OpDisassembleResult {
/// Stringified representation of a disassembled machine word.
QString repr;
/// Number of bytes disassembled.
- unsigned bytesDisassembled;
+ unsigned bytesDisassembled = 0;
/// Optional error that occured during disassembly.
std::optional<Error> err;
};

MODIFY
src/assembler/objdump.cpp
src/assembler/objdump.cpp
@@ -60,6 +60,7 @@ QString stringifyProgram(std::weak_ptr<const Program> program, Stringifier strin
// Stringified instruction
auto disres = stringifier(buffer, addr);
+ assert(buffer.size() >= disres.bytesDisassembled);
// Instruction word
QString wordString;

Initialize bytesDisassembled in opDisassembleResult