Closed Bug 1977692 Opened 4 months ago Closed 4 months ago

ToWebAssemblyValue for i31ref should permit -0

Categories

(Core :: JavaScript: WebAssembly, task, P3)

task

Tracking

()

RESOLVED FIXED
143 Branch
Tracking Status
firefox143 --- fixed

People

(Reporter: rhunt, Assigned: bvisness)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

See [1] step 6.4: Else if v is a Number and v is equal to ? ToInt32(v) and ℝ(v) < 2^30 and ℝ(v) ⩾ -2^30

ToInt32(-0) [2] will return +0, and -0 == 0, so we should succeed in the conversion to i31ref. The result should be ref.i31 0.

We have tests of the opposite that should be updated [3].

[1] https://webassembly.github.io/gc/js-api/index.html#towebassemblyvalue
[2] https://tc39.es/ecma262/multipage/abstract-operations.html#sec-toint32
[3] https://searchfox.org/mozilla-central/rev/4e4c6befbae5dccbe4c718d6871f75c16d97f82d/js/src/jit-test/tests/wasm/gc/i31ref.js#9

Assignee: nobody → bvisness
Status: NEW → ASSIGNED

This required changing the C++ conversion path (deep in
ToWebAssemblyValue) and the JIT entry path.

Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
QA Whiteboard: [qa-triage-done-c144/b143]
Blocks: 1992240
Regressions: 1997423
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: