From 5ee58d181d36b4ebcfb7a11e7bc597e14e29d9de Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 25 Jul 2019 14:50:06 +0100 Subject: [PATCH] rust: add assertion for evmc_context.host --- bindings/rust/evmc-vm/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/bindings/rust/evmc-vm/src/lib.rs b/bindings/rust/evmc-vm/src/lib.rs index 597488c..772064f 100644 --- a/bindings/rust/evmc-vm/src/lib.rs +++ b/bindings/rust/evmc-vm/src/lib.rs @@ -173,6 +173,7 @@ impl ExecutionMessage { impl<'a> ExecutionContext<'a> { pub fn new(_context: &'a mut ffi::evmc_context) -> Self { + assert!(_context.host != std::ptr::null()); let _tx_context = unsafe { assert!((*(_context.host)).get_tx_context.is_some()); (*(_context.host)).get_tx_context.unwrap()(_context as *mut ffi::evmc_context)