From 92803155cb2743311ae0da8ecf314e9947fa8cc0 Mon Sep 17 00:00:00 2001 From: dennismckinnon Date: Thu, 10 Apr 2014 13:49:23 -0400 Subject: [PATCH] Fixed EXP operation --- libethereum/VM.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libethereum/VM.h b/libethereum/VM.h index 99b0a4740..19ca1a3bf 100644 --- a/libethereum/VM.h +++ b/libethereum/VM.h @@ -228,11 +228,12 @@ template eth::bytesConstRef eth::VM::go(Ext& _ext, uint64_t _steps) { // TODO: better implementation? require(2); - auto n = m_stack.back(); + auto base = m_stack.back(); auto x = m_stack[m_stack.size() - 2]; m_stack.pop_back(); + u256 n = 1; for (u256 i = 0; i < x; ++i) - n *= n; + n = (u256) n * base; m_stack.back() = n; break; }