diff --git a/ethcore/wasm/src/runtime.rs b/ethcore/wasm/src/runtime.rs index 3dfaffad0..3c2bd101e 100644 --- a/ethcore/wasm/src/runtime.rs +++ b/ethcore/wasm/src/runtime.rs @@ -627,30 +627,30 @@ impl<'a, 'b> Runtime<'a, 'b> { fn user_panic(&mut self, context: InterpreterCallerContext) -> Result, InterpreterError> { - let payload_len = context.value_stack.pop_as::()? as u32; - let payload_ptr = context.value_stack.pop_as::()? as u32; + let payload_len = context.value_stack.pop_as::()? as u32; + let payload_ptr = context.value_stack.pop_as::()? as u32; - let raw_payload = self.memory.get(payload_ptr, payload_len as usize)?; - let payload = panic_payload::decode(&raw_payload); - let msg = format!( - "{msg}, {file}:{line}:{col}", - msg = payload - .msg - .as_ref() - .map(String::as_ref) - .unwrap_or(""), - file = payload - .file - .as_ref() - .map(String::as_ref) - .unwrap_or(""), - line = payload.line.unwrap_or(0), - col = payload.col.unwrap_or(0) - ); - trace!(target: "wasm", "Contract custom panic message: {}", msg); + let raw_payload = self.memory.get(payload_ptr, payload_len as usize)?; + let payload = panic_payload::decode(&raw_payload); + let msg = format!( + "{msg}, {file}:{line}:{col}", + msg = payload + .msg + .as_ref() + .map(String::as_ref) + .unwrap_or(""), + file = payload + .file + .as_ref() + .map(String::as_ref) + .unwrap_or(""), + line = payload.line.unwrap_or(0), + col = payload.col.unwrap_or(0) + ); + trace!(target: "wasm", "Contract custom panic message: {}", msg); - Err(UserTrap::Panic(msg).into()) - } + Err(UserTrap::Panic(msg).into()) + } fn block_hash(&mut self, context: InterpreterCallerContext) -> Result, InterpreterError>