From ddb6392338047ea565dbb44ffbd6064d35dfc9dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 14 Oct 2014 10:30:39 +0200 Subject: [PATCH] Throw bad instruction exception in case instruction is bad --- libevm/VM.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libevm/VM.h b/libevm/VM.h index 7c1e66ed5..a1cb3eccb 100644 --- a/libevm/VM.h +++ b/libevm/VM.h @@ -188,6 +188,10 @@ template dev::bytesConstRef dev::eth::VM::go(Ext& _ext, OnOpFunc con // EXECUTE... switch (inst) { + default: + BOOST_THROW_EXCEPTION(BadInstruction()); + break; + case Instruction::ADD: //pops two items and pushes S[-1] + S[-2] mod 2^256. require(2);