From 4b33b101ed32792489ff640788430eabd18f641c Mon Sep 17 00:00:00 2001 From: Brandon Fish Date: Sun, 16 Dec 2018 10:43:35 -0600 Subject: [PATCH] Add a debug messages for mocked missing globals and tables --- src/webassembly/instance.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/webassembly/instance.rs b/src/webassembly/instance.rs index fdcdeefd7..84a464d2d 100644 --- a/src/webassembly/instance.rs +++ b/src/webassembly/instance.rs @@ -394,6 +394,10 @@ impl Instance { Some(ImportValue::Global(value)) => *value, None => { if options.mock_missing_globals { + debug!( + "The Imported global {}.{} is not provided, therefore will be mocked.", + module_name, field_name + ); 0 } else { panic!( @@ -430,6 +434,10 @@ impl Instance { Some(ImportValue::Table(t)) => t.to_vec(), None => { if options.mock_missing_tables { + debug!( + "The Imported table {}.{} is not provided, therefore will be mocked.", + module_name, field_name + ); let len = table.entity.size; let mut v = Vec::with_capacity(len); v.resize(len, 0);