Detect and skip padding nops at the end of functions

This commit is contained in:
Kingcom 2014-03-02 10:46:43 +01:00
parent 7a20d94536
commit 0ade0a44b5
1 changed files with 6 additions and 0 deletions

View File

@ -115,6 +115,11 @@ namespace MIPSAnalyst
} }
*/ */
if (end) { if (end) {
// most functions are aligned to 8 or 16 bytes
// add the padding to this one
while (r5900Debug.read32(addr+8) == 0)
addr += 4;
currentFunction.end = addr + 4; currentFunction.end = addr + 4;
currentFunction.isStraightLeaf = isStraightLeaf; currentFunction.isStraightLeaf = isStraightLeaf;
functions.push_back(currentFunction); functions.push_back(currentFunction);
@ -123,6 +128,7 @@ namespace MIPSAnalyst
looking = false; looking = false;
end = false; end = false;
isStraightLeaf = true; isStraightLeaf = true;
currentFunction.start = addr+4; currentFunction.start = addr+4;
} }
} }