Skip to content
Snippets Groups Projects
  • Geo Ster's avatar
    9ec5b188
    Fix bug in the BEQ/BEQL/BNEL instructions · 9ec5b188
    Geo Ster authored
    * Seems like branches really do love having bugs in them ;)
    The bug was noticed when the BEQ instruction was provided 0xffd1 as the offset.
    Decompiling with ghidra revealed that the offset was -0xbc or -188 as signed
    but with this bug the value would be 261956 which completely broke
    the program. Fix this by first casting to int16_t to let the
    compiler know that we are giving it a 16bit signed int and then convert
    it to int32_t
    
    * In addition make stores/loads bold so I can notice them better, as
    log output is starting to incrase exponentially
    9ec5b188
    History
    Fix bug in the BEQ/BEQL/BNEL instructions
    Geo Ster authored
    * Seems like branches really do love having bugs in them ;)
    The bug was noticed when the BEQ instruction was provided 0xffd1 as the offset.
    Decompiling with ghidra revealed that the offset was -0xbc or -188 as signed
    but with this bug the value would be 261956 which completely broke
    the program. Fix this by first casting to int16_t to let the
    compiler know that we are giving it a 16bit signed int and then convert
    it to int32_t
    
    * In addition make stores/loads bold so I can notice them better, as
    log output is starting to incrase exponentially
manager.cpp 1.70 KiB