Skip to content

unchecked buffer acceess still call standard checked operators #515

Closed
@MaxGraey

Description

@MaxGraey

Example:

export function test(outArr: Int32Array, inArr: Int32Array): void {
  unchecked(outArr[0] = unchecked(inArr[0]));
}

output:

(func $test (export "test") (type $t0) (param $p0 i32) (param $p1 i32)
    get_local $p0
    get_local $p1
    i32.load offset=4
    get_local $p1
    i32.load
    i32.add
    i32.load offset=8
    call $f1                         ;;;; <- get
    get_local $p1
    call $f2                         ;;;; <- set
    drop)

Fiddle: https://webassembly.studio/?f=7b22w1vr35c

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