Skip to content

[EH] Fuzz exnref in tables#7289

Merged
kripken merged 16 commits intoWebAssembly:mainfrom
kripken:fuzz.exn.table
Feb 14, 2025
Merged

[EH] Fuzz exnref in tables#7289
kripken merged 16 commits intoWebAssembly:mainfrom
kripken:fuzz.exn.table

Conversation

@kripken
Copy link
Copy Markdown
Member

@kripken kripken commented Feb 11, 2025

  • Add an exnref table.
  • Add table operations (also for funcref, while we are at it).
  • Add exnref to getConcrete, so there is a chance to emit table.get

Opening as draft as I see some fuzzer errors that need to be fixed.

@kripken
Copy link
Copy Markdown
Member Author

kripken commented Feb 12, 2025

This depends on #7290 but otherwise looks stable under fuzzing.

@kripken kripken marked this pull request as ready for review February 12, 2025 00:40
@kripken kripken requested review from aheejin and tlively February 12, 2025 00:49
Comment thread src/tools/fuzzing/fuzzing.cpp Outdated
index = make(table->addressType);
} else {
index = builder.makeConst(
Literal::makeFromInt32(table->initial, table->addressType));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we only get from the initial index? (The same for table.set)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch! This should be upTo(table->initial). Fixed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So we don't support table.grow in the fuzzer and the size is the same as initial?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We should add table.grow support, but yeah, for now the size will be fixed.

if (type.getHeapType() == HeapType::exn) {
return makeTableGet(exnrefTableName);
} else {
return makeTableGet(funcrefTableName);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it always HeapType::func here? Can we assert? (The same for makeTableSet)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good idea, I added asserts.

@kripken
Copy link
Copy Markdown
Member Author

kripken commented Feb 13, 2025

CI errors here might be fixed by #7288

@kripken kripken enabled auto-merge (squash) February 14, 2025 01:21
@kripken kripken merged commit 19dd23d into WebAssembly:main Feb 14, 2025
@kripken kripken deleted the fuzz.exn.table branch February 14, 2025 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants