Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EH] Fuzz exnref in tables #7289

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

kripken
Copy link
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
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 tlively and aheejin February 12, 2025 00:49
index = make(table->addressType);
} else {
index = builder.makeConst(
Literal::makeFromInt32(table->initial, table->addressType));
Copy link
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
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
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
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
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
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
Member Author

kripken commented Feb 13, 2025

CI errors here might be fixed by #7288

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