Skip to content

Fixed-length lists can overflow in ABI calculations for the size of the list #13980

Description

@alexcrichton

This input:

(component
  (type $l (list u64 1073741824))
  (type $t (tuple $l $l))
  (type $f (func (param "a" $t)))
  (import "x" (func (type $f)))
)

fails with:

$ cargo run compile bigflist3.wat -W component-model-fixed-length-lists
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s
     Running `/home/alex/code/wasmtime2/target/debug/wasmtime compile bigflist3.wat -W component-model-fixed-length-lists`

thread 'main' (2608010) panicked at crates/environ/src/component/types.rs:679:5:
attempt to add with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Metadata

Metadata

Assignees

No one assigned

    Labels

    wasm-proposal:component-modelIssues related to the WebAssembly Component Model proposal

    Type

    No type

    Projects

    Status
    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions