Fix set wasi args order (#2485)

set_wasi_args should be called before module instantiation.
This commit is contained in:
tonibofarull 2023-08-22 02:50:26 +02:00 committed by GitHub
parent f0632edc37
commit 59bedecc5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,12 +131,12 @@ class Instance:
):
# Store module ensures GC does not remove it
self.module = module
if dir_list:
self._set_wasi_args(module, dir_list)
if preinitialized_module_inst is None:
self.module_inst = self._create_module_inst(module, stack_size, heap_size)
else:
self.module_inst = preinitialized_module_inst
if dir_list:
self._set_wasi_args(module, dir_list)
def __del__(self):
print("deleting Instance")