wasm-e2e icon indicating copy to clipboard operation
wasm-e2e copied to clipboard

using char as return value fails

Open binji opened this issue 9 years ago • 0 comments

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"

binji avatar Oct 27 '15 22:10 binji