binji / wasm-e2e

Temporary scaffolding for running WebAssembly end-to-end, from C++ to browsers.
Apache License 2.0
23 stars 4 forks source link

using char as return value fails #2

Open binji opened 9 years ago

binji commented 9 years ago
char hexit(int x) {
  return "0123456789abcdef"[x];
}

This generates output:

  (func $hexit
    (param i32)
    (result i8)
    (local i32 i32 i32 i32)
    (set_local 1 (get_local 0))
    (set_local 2 (i32.const 0))
    (set_local 3 (i32.add (get_local 2) (get_local 1)))
    (set_local 4 (i32.load8_s (get_local 3)))
    (return (get_local 4))
  )

with error:

hex.wast:10:13: unexpected token "i8"