Skip to content

invoke outputs garbage #122

@kg

Description

@kg

When invoking functions with a void return type, ml-proto acts like they have a return type and outputs garbage (the last expression in the function body, seems like?)

(module 
  (import $write "stdio" "write" (param i32 i32))

  (memory 4096 4096 (segment 0 "\89\50\4e\47\0d\0a\1a\0a\00"))

  (func $write_png_header
    (call_import $write (i32.const 0) (i32.const 9))
    (i32.const 7)
  )

  (export "write_png_header" $write_png_header)
)

(invoke "write_png_header")

prints 7 : i32 at the end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions