fix: byte、short 位运算转为 int 的问题
This commit is contained in:
parent
fa91550ad7
commit
5d621e06b5
@ -49,7 +49,7 @@ public class BAndCommand implements Command {
|
|||||||
final byte a = (byte) operandStack.pop();
|
final byte a = (byte) operandStack.pop();
|
||||||
|
|
||||||
// Perform the byte8 bitwise AND operation and push the result back onto the stack
|
// Perform the byte8 bitwise AND operation and push the result back onto the stack
|
||||||
operandStack.push(a & b);
|
operandStack.push((byte)(a & b));
|
||||||
|
|
||||||
return currentPC + 1;
|
return currentPC + 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,7 +49,7 @@ public class BOrCommand implements Command {
|
|||||||
final byte a = (byte) operandStack.pop();
|
final byte a = (byte) operandStack.pop();
|
||||||
|
|
||||||
// Perform the byte8 bitwise OR operation and push the result back onto the stack
|
// Perform the byte8 bitwise OR operation and push the result back onto the stack
|
||||||
operandStack.push(a | b);
|
operandStack.push((byte)(a | b));
|
||||||
|
|
||||||
return currentPC + 1;
|
return currentPC + 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,7 +49,7 @@ public class BXorCommand implements Command {
|
|||||||
final byte a = (byte) operandStack.pop();
|
final byte a = (byte) operandStack.pop();
|
||||||
|
|
||||||
// Perform the byte8 bitwise XOR operation and push the result back onto the stack
|
// Perform the byte8 bitwise XOR operation and push the result back onto the stack
|
||||||
operandStack.push(a ^ b);
|
operandStack.push((byte)(a ^ b));
|
||||||
|
|
||||||
return currentPC + 1;
|
return currentPC + 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,7 +49,7 @@ public class SAndCommand implements Command {
|
|||||||
final short a = (short) operandStack.pop();
|
final short a = (short) operandStack.pop();
|
||||||
|
|
||||||
// Perform the short16 bitwise AND operation and push the result back onto the stack
|
// Perform the short16 bitwise AND operation and push the result back onto the stack
|
||||||
operandStack.push(a & b);
|
operandStack.push((short)(a & b));
|
||||||
|
|
||||||
return currentPC + 1;
|
return currentPC + 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,7 +49,7 @@ public class SOrCommand implements Command {
|
|||||||
final short a = (short) operandStack.pop();
|
final short a = (short) operandStack.pop();
|
||||||
|
|
||||||
// Perform the short16 bitwise OR operation and push the result back onto the stack
|
// Perform the short16 bitwise OR operation and push the result back onto the stack
|
||||||
operandStack.push(a | b);
|
operandStack.push((short)(a | b));
|
||||||
|
|
||||||
return currentPC + 1;
|
return currentPC + 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,7 +49,7 @@ public class SXorCommand implements Command {
|
|||||||
final short a = (short) operandStack.pop();
|
final short a = (short) operandStack.pop();
|
||||||
|
|
||||||
// Perform the short16 bitwise XOR operation and push the result back onto the stack
|
// Perform the short16 bitwise XOR operation and push the result back onto the stack
|
||||||
operandStack.push(a ^ b);
|
operandStack.push((short)(a ^ b));
|
||||||
|
|
||||||
return currentPC + 1;
|
return currentPC + 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user