/** * Handler for all instructions which pop values from the stack and store * them in a local variable. Note that two locals are stored into for long * and double stores. */ public void handleStoreInstruction(StoreInstruction obj) { try { int numConsumed = obj.consumeStack(cpg); if (numConsumed == Const.UNPREDICTABLE) { throw new InvalidBytecodeException("Unpredictable stack consumption"); } int index = obj.getIndex(); // Store values into consecutive locals corresponding // to the order in which the values appeared on the stack. while (numConsumed-- > 0) { Value value = frame.popValue(); frame.setValue(index++, value); } } catch (DataflowAnalysisException e) { throw new InvalidBytecodeException(e.toString()); } }
/** * Handler for all instructions which pop values from the stack and store * them in a local variable. Note that two locals are stored into for long * and double stores. */ public void handleStoreInstruction(StoreInstruction obj) { try { int numConsumed = obj.consumeStack(cpg); if (numConsumed == Constants.UNPREDICTABLE) { throw new InvalidBytecodeException("Unpredictable stack consumption"); } int index = obj.getIndex(); // Store values into consecutive locals corresponding // to the order in which the values appeared on the stack. while (numConsumed-- > 0) { Value value = frame.popValue(); frame.setValue(index++, value); } } catch (DataflowAnalysisException e) { throw new InvalidBytecodeException(e.toString()); } }