wasmer-python icon indicating copy to clipboard operation
wasmer-python copied to clipboard

No error report?

Open orangeC23 opened this issue 1 year ago • 0 comments

Describe the bug

This wasm file is to test whether a wasm runtime could deal with the error of index out of bounds errors when import_global_index is greeter than imports.globals length. The wasm file is : C2-1-wasm.txt The python file is :

import os

from wasmer import engine, wat2wasm, Store, Module, Instance, wasi
# from wasmer_compiler_cranelift import Compiler
# from wasmer_compiler_llvm import Compiler
from wasmer_compiler_singlepass import Compiler

engine = engine.Universal(Compiler)

# Create a store, that holds the engine.
store = Store(engine)

# Let's compile the Wasm module with the Cranelift compiler.
__dir__ = os.path.dirname(os.path.realpath(__file__))
module = Module(Store(), open(__dir__ + './tmp.wasm', 'rb').read())

instance = Instance(module)

Steps to reproduce

python tmp.py

Expected behavior

Report index out of bounds error.

Actual behavior

The output of wasmer is: │ 1: module instantiation failed (engine: universal, compiler: cranelift) ╰─▶ 2: Validation error: constant expression required: global.get of locally defined global (at offset 18)

However, wasmer python print nothing.

orangeC23 avatar Apr 10 '23 08:04 orangeC23