Stream: git-wasmtime

Topic: wasmtime / PR #7499 winch: Properly handle unconditional ...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 08 2023 at 15:26):

saulecabrera opened PR #7499 from saulecabrera:winch-semantically-respect-stack-excess to bytecodealliance:main:

This commit improves unconditional jumps by balancing the stack pointer as well as the value stack when the current stack pointer and value stack are greater than the target stack pointer and value stack. The invariant that this changes maintains is that the the value stack should always reflect the the state of the machine stack. The value stack might have excess stack values in a presence of a fallthrough (br_if or br_table) in which the target branch is not known at compile time; in this situation instructions like return or br discard any excess values.

The fuzzer discovered the following test case, which triggered several assertions related to unconditional jump handling:

(module
  (func (;0;) (result i32)
    (local i32)
    local.get 0
    loop ;; label = @1
      local.get 0
      block ;; label = @2
      end
      br 0 (;@1;)
    end
  )
  (export "" (func 0))
)

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Nov 08 2023 at 15:26):

saulecabrera requested elliottt for a review on PR #7499.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 08 2023 at 15:26):

saulecabrera requested wasmtime-compiler-reviewers for a review on PR #7499.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2023 at 22:39):

elliottt submitted PR review:

Looks good to me!

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2023 at 23:41):

saulecabrera merged PR #7499.


Last updated: Nov 22 2024 at 16:03 UTC