Fixing BYTE instruction

This commit is contained in:
Tomusdrw
2016-01-15 19:48:51 +01:00
parent 7af4825b15
commit 46ecb16191
2 changed files with 3 additions and 2 deletions

View File

@@ -837,8 +837,9 @@ impl Interpreter {
},
instructions::BYTE => {
let word = stack.pop_back();
let val = stack.pop_back();
let byte = if word < U256::from(32) {
word >> (8 * (31 - word.low_u64() as usize))
(val >> (8 * (31 - word.low_u64() as usize))) & U256::from(0xff)
} else {
U256::zero()
};