fix PowerPC tails=true stack undwinding

This commit is contained in:
Joel Dice 2011-03-01 11:01:13 -07:00
parent 8f519531d4
commit 30feba8b56

View File

@ -1939,11 +1939,11 @@ nextFrame(ArchitectureContext* c UNUSED, int32_t* start, unsigned size,
// check for post-non-tail-call stack adjustment of the form "lwzx
// r0,0(r1); stwu r0,offset(r1)":
if (instruction < start + (size / BytesPerWord) - 1
and (static_cast<uint32_t>(instruction[1]) >> 16) == 0x9421)
and (static_cast<uint32_t>(instruction[1]) >> 16) == 0x9401)
{
offset += static_cast<int16_t>(instruction[1]);
} else if ((static_cast<uint32_t>(*instruction) >> 16) == 0x9421) {
offset += static_cast<int16_t>(*instruction);
offset += static_cast<int16_t>(instruction[1]) / BytesPerWord;
} else if ((static_cast<uint32_t>(*instruction) >> 16) == 0x9401) {
offset += static_cast<int16_t>(*instruction) / BytesPerWord;
}
// todo: check for and handle tail calls