* throw if the value is out of the range of a signed int.
*/
public final int getLiteralInt() {
- if (literal != (int) target) {
+ if (literal != (int) literal) {
throw new DexException("Literal out of range: " + Hex.u8(literal));
}
* value is out of the range of a signed code unit.
*/
public final short getLiteralUnit() {
- if (literal != (short) target) {
+ if (literal != (short) literal) {
throw new DexException("Literal out of range: " + Hex.u8(literal));
}
* throw if the value is out of the range of a signed byte.
*/
public final int getLiteralByte() {
- if (literal != (byte) target) {
+ if (literal != (byte) literal) {
throw new DexException("Literal out of range: " + Hex.u8(literal));
}
@Override public void encode(DecodedInstruction insn, CodeOutput out) {
out.write(
codeUnit(insn.getOpcode(), insn.getA()),
- insn.getLiteralUnit());
+ insn.getIndexUnit());
}
},
}
@Override public void encode(DecodedInstruction insn, CodeOutput out) {
- int literal = insn.getLiteralInt();
+ long literal = insn.getLiteral();
out.write(
codeUnit(insn.getOpcode(), insn.getA()),
unit0(literal),
/** @inheritDoc */
public int readInt() throws EOFException {
- int short0 = read();
- int short1 = read();
+ int short0 = read() & 0xffff;
+ int short1 = read() & 0xffff;
return short0 | (short1 << 16);
}
/** @inheritDoc */
public long readLong() throws EOFException {
- long short0 = read();
- long short1 = read();
- long short2 = read();
- long short3 = read();
+ long short0 = read() & 0xffff;
+ long short1 = read() & 0xffff;
+ long short2 = read() & 0xffff;
+ long short3 = read() & 0xffff;
return short0 | (short1 << 16) | (short2 << 32) | (short3 << 48);
}
package com.android.dx.merge;
import com.android.dx.io.CodeReader;
-import com.android.dx.io.OpcodeInfo;
import com.android.dx.io.instructions.DecodedInstruction;
import com.android.dx.io.instructions.ShortArrayCodeOutput;
import com.android.dx.util.DexException;
throw new DexException("Cannot handle conversion to jumbo index!");
}
}
-
}