OSDN Git Service

Don't throw an AssertionError on invalid input.
authorJesse Wilson <jessewilson@google.com>
Tue, 13 Dec 2011 21:42:38 +0000 (16:42 -0500)
committerJesse Wilson <jessewilson@google.com>
Tue, 13 Dec 2011 21:42:38 +0000 (16:42 -0500)
Throwing an AssertionError prevents tools like FindUsages from
recovering.

Bug: http://b/5470168
Change-Id: I6ae99bd29e25f868a739548266cedf85d0b26e90

dx/src/com/android/dx/io/instructions/DecodedInstruction.java

index e418a1c..9d9e88e 100644 (file)
@@ -21,7 +21,6 @@ import com.android.dx.io.OpcodeInfo;
 import com.android.dx.io.Opcodes;
 import com.android.dx.util.DexException;
 import com.android.dx.util.Hex;
-
 import java.io.EOFException;
 
 /**
@@ -90,7 +89,7 @@ public abstract class DecodedInstruction {
                 decoded[in.cursor()] = DecodedInstruction.decode(in);
             }
         } catch (EOFException ex) {
-            throw new AssertionError("shouldn't happen");
+            throw new DexException(ex);
         }
 
         return decoded;