Skip to content

Variable not cleared #242

Description

@zherczeg

Test case:

(func (export "test10") (param i32) (result i32) (local i32).
   local.get 0
   if
     local.get 0
     i32.const 6
     i32.div_s
     local.set 1
   end

   local.get 1
)

Byte code dump:

     0 const32 dstOffset: 16 value: 6
    16 jump_if_false srcOffset: 0 dst: 48
    32 I32DivS src1: 0 src2: 16 dst: 8
    48 end resultOffsets: 8

It seems local 1 is not set to zero, and the function may return with garbage.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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