|
@@ -206,6 +206,8 @@ InstantiationResult AbstractMachine::instantiate(Module const& module, Vector<Ex
|
|
for (auto& entry : externs) {
|
|
for (auto& entry : externs) {
|
|
if (auto* ptr = entry.get_pointer<GlobalAddress>())
|
|
if (auto* ptr = entry.get_pointer<GlobalAddress>())
|
|
auxiliary_instance.globals().append(*ptr);
|
|
auxiliary_instance.globals().append(*ptr);
|
|
|
|
+ else if (auto* ptr = entry.get_pointer<FunctionAddress>())
|
|
|
|
+ auxiliary_instance.functions().append(*ptr);
|
|
}
|
|
}
|
|
|
|
|
|
Vector<FunctionAddress> module_functions;
|
|
Vector<FunctionAddress> module_functions;
|
|
@@ -253,7 +255,7 @@ InstantiationResult AbstractMachine::instantiate(Module const& module, Vector<Ex
|
|
if (m_should_limit_instruction_count)
|
|
if (m_should_limit_instruction_count)
|
|
config.enable_instruction_count_limit();
|
|
config.enable_instruction_count_limit();
|
|
config.set_frame(Frame {
|
|
config.set_frame(Frame {
|
|
- main_module_instance,
|
|
|
|
|
|
+ auxiliary_instance,
|
|
Vector<Value> {},
|
|
Vector<Value> {},
|
|
entry,
|
|
entry,
|
|
entry.instructions().size(),
|
|
entry.instructions().size(),
|
|
@@ -306,7 +308,7 @@ InstantiationResult AbstractMachine::instantiate(Module const& module, Vector<Ex
|
|
if (m_should_limit_instruction_count)
|
|
if (m_should_limit_instruction_count)
|
|
config.enable_instruction_count_limit();
|
|
config.enable_instruction_count_limit();
|
|
config.set_frame(Frame {
|
|
config.set_frame(Frame {
|
|
- main_module_instance,
|
|
|
|
|
|
+ auxiliary_instance,
|
|
Vector<Value> {},
|
|
Vector<Value> {},
|
|
active_ptr->expression,
|
|
active_ptr->expression,
|
|
1,
|
|
1,
|
|
@@ -361,7 +363,7 @@ InstantiationResult AbstractMachine::instantiate(Module const& module, Vector<Ex
|
|
if (m_should_limit_instruction_count)
|
|
if (m_should_limit_instruction_count)
|
|
config.enable_instruction_count_limit();
|
|
config.enable_instruction_count_limit();
|
|
config.set_frame(Frame {
|
|
config.set_frame(Frame {
|
|
- main_module_instance,
|
|
|
|
|
|
+ auxiliary_instance,
|
|
Vector<Value> {},
|
|
Vector<Value> {},
|
|
data.offset,
|
|
data.offset,
|
|
1,
|
|
1,
|