summaryrefslogtreecommitdiff
path: root/test/lit/binary/data-names.test.wasm
Commit message (Collapse)AuthorAgeFilesLines
* Fix DataSegment name handling (#6673)Alon Zakai2024-06-171-0/+0
The code used i instead of index, as in this pseudocode: for i in range(num_names): index = readU32LEB() # index of the data segment to name name = readName() # name to give that segment data[i] = name # XXX 'i' should be 'index' That (funnily enough) happened to always work before since we write names in order. That is, normally given segments A,B,C we'd write then in the names section as A,B,C. Then the reader, which had the bug, would always have i and index identical in value anyhow. But if a wasm producer used different indexes, a problem could happen. To test this, add a binary file that has a reversed name section. Fixes #6672