Closed Bug 1863737 Opened 2 years ago Closed 2 years ago

extern.internalize/externalize needs to preserve non-null input types

Categories

(Core :: JavaScript: WebAssembly, defect, P2)

defect

Tracking

()

RESOLVED INVALID

People

(Reporter: rhunt, Assigned: jpages)

References

Details

See [1] for spec text.

The following example should validate:

(func (param (ref extern)) (result (ref any)))
  (extern.internalize (local.get 0))
)

However, looking at our validation rules [2], we don't have anything to preserve non-nullable information. So I am fairly sure this test case will fail to validate.

[1] https://webassembly.github.io/gc/core/valid/instructions.html#external-reference-instructions
[2] https://searchfox.org/mozilla-central/rev/02841791400cf7cf5760c0cfaf31f5d772624253/js/src/wasm/WasmValidate.cpp#738-739

Assignee: nobody → jpages

I think the non-nullable information is preserved in function readRefConversion [1]. And this test case validates.

[1] https://searchfox.org/mozilla-central/source/js/src/wasm/WasmOpIter.h#3885-3887

Ah, I misread it and saw readConversion (which does not do that). That's what I get for not actually building and testing this. Thanks!

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.