-
Bug
-
Resolution: Fixed
-
P4
-
repo-valhalla
-
generic
-
generic
The following fails to verify:
// ---
public class X {
static __ByValue class V {
int x;
V() {
int l = 0;
l += x = 1234;
}
}
public static void main(String[] args) {
V v = new V();
System.out.println(v);
}
}
When run I get:
Exception in thread "main" java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
X$V.$makeValue$()LX$V; @16: i2b
Reason:
Type 'X$V' (current frame, stack[1]) is not assignable to integer
Current Frame:
bci: @16
flags: { }
locals: { 'X$V', integer }
stack: { integer, 'X$V' }
Bytecode:
0000000: cb00 064b 033c 1b2a 1104 d2cc 0007 594b
0000010: 9160 3c2a b0
at X.main(X.java:12)
// ---
public class X {
static __ByValue class V {
int x;
V() {
int l = 0;
l += x = 1234;
}
}
public static void main(String[] args) {
V v = new V();
System.out.println(v);
}
}
When run I get:
Exception in thread "main" java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
X$V.$makeValue$()LX$V; @16: i2b
Reason:
Type 'X$V' (current frame, stack[1]) is not assignable to integer
Current Frame:
bci: @16
flags: { }
locals: { 'X$V', integer }
stack: { integer, 'X$V' }
Bytecode:
0000000: cb00 064b 033c 1b2a 1104 d2cc 0007 594b
0000010: 9160 3c2a b0
at X.main(X.java:12)