Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error print the result? #709

Open
orangeC23 opened this issue Apr 10, 2023 · 0 comments
Open

Error print the result? #709

orangeC23 opened this issue Apr 10, 2023 · 0 comments
Labels
🐞 bug Something isn't working

Comments

@orangeC23
Copy link

orangeC23 commented Apr 10, 2023

Describe the bug

Error print when executing the following wat file.

Steps to reproduce

The wat file is :

(module
  (func (result i64)
      v128.const i64x2 -1 1
      global.get 0
      f64x2.replace_lane 0
      i64x2.extract_lane 1
  )

  (global f64 (f64.const 1))
  (export "func1" (func 0)))

The python file is :

import os

from wasmer import engine, wat2wasm, Store, Module, Instance
# 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())

# Let's instantiate the Wasm module.
instance = Instance(module)

# Let's call the `sum` exported function.
func1 = instance.exports.func1
results = func1()

print(results)

Execute:

wat2wasm tmp.wat
python tmp.py

Expected behavior

Print 1

Actual behavior

Print 0

@orangeC23 orangeC23 added the 🐞 bug Something isn't working label Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant