Fix an issue when the current address immediatly after an AdvancePC debug instruction doesn't point to an instruction

git-svn-id: https://smali.googlecode.com/svn/trunk@515 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
JesusFreke@JesusFreke.com
2009-12-23 23:46:18 +00:00
parent 2ededb89b9
commit 2904f40603

View File

@ -639,6 +639,16 @@ public class CodeItem extends Item<CodeItem> {
}
int newOffset = newOffsetsByOriginalOffset.get(address*2, -1);
//The address might not point to an actual instruction in some cases, for example, if an AdvancePC
//instruction was inserted just before a "special" instruction, to fix up the offsets for a previous
//instruction replacement.
//In this case, it should be safe to skip, because there will be another AdvancePC/SpecialOpcode that will
//bump up the address to point to a valid instruction before anything (line/local/etc.) is emitted
if (newOffset == -1) {
return;
}
assert newOffset != -1;
newOffset = newOffset / 2;