Throw an error if a switch data pseudo-instruction is encountered when auto-fixing a method.

git-svn-id: https://smali.googlecode.com/svn/trunk@518 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
JesusFreke@JesusFreke.com 2009-12-24 08:07:44 +00:00
parent a8ca776c1d
commit 146fbfd33a

View File

@ -549,8 +549,7 @@ public class CodeItem extends Item<CodeItem> {
int originalSwitchOffset = originalSwitchOffsetByOriginalSwitchDataOffset.get(originalDataOffset); int originalSwitchOffset = originalSwitchOffsetByOriginalSwitchDataOffset.get(originalDataOffset);
if (originalSwitchOffset == 0) { if (originalSwitchOffset == 0) {
//TODO: is it safe to skip an unreferenced switch data instruction? Or should it throw an exception? throw new RuntimeException("This method contains an unreferenced switch data block, and can't be automatically fixed.");
continue;
} }
assert newOffsetsByOriginalOffset.indexOfKey(originalSwitchOffset) >= 0; assert newOffsetsByOriginalOffset.indexOfKey(originalSwitchOffset) >= 0;