Skip to content

[acorn-optimizer] unsignPointers can cause problems optional second argument subarray #21250

Open
@sbc100

Description

@sbc100

The unsignPointers pass will currently add >>> 0 to all arguments to \.subarray.

However, if the value being passed is undefined this changes its meaning.

The case I found was in library_glemu.js which does something like this: HEAP16.subarray(ptr, end ? end : undefined).

In the case when end is undefined this ends up being end >>> 0 which is 0, and which is very different to undefined when passed as this argument.

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