Skip to content

Valstack Bug #140

Open
Open
@QianyangPeng

Description

@QianyangPeng

I have a test case:

(module
  (func (export "unmatch") (result i32) (i64.const 700))
)

(invoke "unmatch")
#assertTopStackExactly < i32 > 123 "dummy test 1"
#assertTopStack < i32 > 456 "dummy test 1"

#clearConfig

The return type of function "unmatch" is not matched with the top of stack, so instead of returning a value, it will keep a #take ( i32 .ValTypes , < i64 > 700 : .ValStack ) ++ .ValStack on the <valstack>.

The interesting thing is that when using Java backend if the <valstack> is at the state above, any stack assertion will pass no matter what value you assert, therefore all assertions becomes useless.

Also, the output of the program above with Ocaml backend is also abnormal. All it outputs is:

#take ( i32  .ValTypes , < i64 > 700 : .ValStack )

, but I think it should output the whole configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions