Skip to content

Incorrect Validation for Element Segment Initialization #4013

Open
@Q1IQ

Description

@Q1IQ

Subject of the issue

iwasm does not correctly handle element segment initialization using global.get for non-imported globals.

Test case

Uploading program.wasm.txt…

Your environment

  • OS: Ubuntu 20.04
  • CPU: amd64
  • WAMR version: iwasm 2.2.0
  • Commands:
iwasm --interp -f main ./program.wasm
iwasm --fast-jit -f main ./program.wasm
iwasm --llvm-jit -f main ./program.wasm
iwasm --multi-tier-jit -f main./program.wasm

Actual behavior

WASM module load failed: unknown global 0

Expected State

Element segment offset expressions should be able to reference both imported and non-imported globals. The module should pass validation without errors.

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