diff --git a/vm.js b/vm.js index 71fbaa71..4ac3c79c 100644 --- a/vm.js +++ b/vm.js @@ -134,6 +134,10 @@ VM.execute = function(ctx) { var methodName = cp[cp[constant.name_and_type_index].name_index].bytes; var signature = cp[cp[constant.name_and_type_index].signature_index].bytes; constant = CLASSES.getMethod(classInfo, methodName, signature, op === 0xb8, op !== 0xb8); + if (!constant) { + ctx.raiseException("java/lang/RuntimeException", + classInfo.className + "." + methodName + "." + signature + " not found"); + } break; default: throw new Error("not support constant type");