From 250b9b500b5c27830d3c5f781e9d1a2960ac2f81 Mon Sep 17 00:00:00 2001 From: Natalia Ukhorskaya Date: Fri, 30 May 2014 12:00:08 +0400 Subject: [PATCH] Eval4j: initialize frame with local variables values using type size #KT-5133 Fixed --- eval4j/src/org/jetbrains/eval4j/jdi/jdiValues.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/eval4j/src/org/jetbrains/eval4j/jdi/jdiValues.kt b/eval4j/src/org/jetbrains/eval4j/jdi/jdiValues.kt index 1c10c518841..c155c691bac 100644 --- a/eval4j/src/org/jetbrains/eval4j/jdi/jdiValues.kt +++ b/eval4j/src/org/jetbrains/eval4j/jdi/jdiValues.kt @@ -33,14 +33,18 @@ fun makeInitialFrame(methodNode: MethodNode, arguments: List): Frame(methodNode.maxLocals, methodNode.maxStack) frame.setReturn(makeNotInitializedValue(Type.getReturnType(methodNode.desc))) + var index = 0 for ((i, arg) in arguments.withIndices()) { - frame.setLocal(i, arg) + frame.setLocal(index++, arg) + if (arg.getSize() == 2) { + frame.setLocal(index++, NOT_A_VALUE) + } } - for (i in arguments.size..methodNode.maxLocals - 1) { - frame.setLocal(i, NOT_A_VALUE) + while (index < methodNode.maxLocals) { + frame.setLocal(index++, NOT_A_VALUE) } - + return frame }