Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/wasm-interpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -4597,7 +4597,8 @@ class ModuleRunnerBase : public ExpressionRunner<SubType> {
// of references in the table! ArrayNew suffers the same problem.
// Fixing it will require changing how we represent segments, at least
// in the interpreter.
data->values[indexVal + i] = self()->visit(seg->data[i]).getSingleValue();
data->values[indexVal + i] =
self()->visit(seg->data[offsetVal + i]).getSingleValue();
Copy link
Member

@kripken kripken Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this looks right, but the spec test array_init_elem.wast does not appear to be disabled, and it appears to have tests with a nonzero offset... how is that possible? @tlively @stevenfontanella any ideas?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the segment used in that test only contains the same reference over and over, so there doesn't end up being a difference when we just read the first element repeatedly.

It's also troubling that the TODO a few lines up doesn't cause us to fail any tests!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tlively should we file a bug against the spec or spec test suite or something like that?

}
return {};
}
Expand Down
Loading