Add a debug messages for mocked missing globals and tables

This commit is contained in:
Brandon Fish 2018-12-16 10:43:35 -06:00
parent ff45aea0ea
commit 4b33b101ed

View File

@ -394,6 +394,10 @@ impl Instance {
Some(ImportValue::Global(value)) => *value, Some(ImportValue::Global(value)) => *value,
None => { None => {
if options.mock_missing_globals { if options.mock_missing_globals {
debug!(
"The Imported global {}.{} is not provided, therefore will be mocked.",
module_name, field_name
);
0 0
} else { } else {
panic!( panic!(
@ -430,6 +434,10 @@ impl Instance {
Some(ImportValue::Table(t)) => t.to_vec(), Some(ImportValue::Table(t)) => t.to_vec(),
None => { None => {
if options.mock_missing_tables { 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 len = table.entity.size;
let mut v = Vec::with_capacity(len); let mut v = Vec::with_capacity(len);
v.resize(len, 0); v.resize(len, 0);