Attempt to split long or double on the stack exception
#KT-3042 Fixed
This commit is contained in:
@@ -443,6 +443,24 @@ public class AsmUtil {
|
||||
genMethodThrow(mv, STUB_EXCEPTION, STUB_EXCEPTION_MESSAGE);
|
||||
}
|
||||
|
||||
public static void swap(InstructionAdapter v, Type stackTop, Type afterTop) {
|
||||
if (stackTop.getSize() == 1) {
|
||||
if (afterTop.getSize() == 1) {
|
||||
v.swap();
|
||||
} else {
|
||||
v.dupX2();
|
||||
v.pop();
|
||||
}
|
||||
} else {
|
||||
if (afterTop.getSize() == 1) {
|
||||
v.dup2X1();
|
||||
} else {
|
||||
v.dup2X2();
|
||||
}
|
||||
v.pop2();
|
||||
}
|
||||
}
|
||||
|
||||
public static void genNotNullAssertionsForParameters(
|
||||
@NotNull InstructionAdapter v,
|
||||
@NotNull GenerationState state,
|
||||
|
||||
@@ -1062,7 +1062,7 @@ public abstract class StackValue {
|
||||
public void store(Type topOfStackType, InstructionAdapter v) {
|
||||
coerceFrom(topOfStackType, v);
|
||||
v.load(index, OBJECT_TYPE);
|
||||
v.swap();
|
||||
AsmUtil.swap(v, sharedTypeForType(this.type), topOfStackType);
|
||||
Type refType = refType(this.type);
|
||||
Type sharedType = sharedTypeForType(this.type);
|
||||
v.visitFieldInsn(PUTFIELD, sharedType.getInternalName(), "ref", refType.getDescriptor());
|
||||
|
||||
Reference in New Issue
Block a user