Skip to content

[Shared-Everything] ArrayRMW and ArrayCmpxchg #7632

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

Merged
merged 35 commits into from
Jun 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix finalize on null refs
  • Loading branch information
kripken committed Jun 2, 2025
commit 5db6b292b9e63f484b75d2fc3fd8cdc28c1202e3
8 changes: 2 additions & 6 deletions src/wasm/wasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1256,9 +1256,7 @@ void StructCmpxchg::finalize() {
replacement->type == Type::unreachable) {
type = Type::unreachable;
} else if (ref->type.isNull()) {
// Like StructRMW, but the most precise possible field type is the LUB of
// the expected and replacement values.
type = Type::getLeastUpperBound(expected->type, replacement->type);
type = replacement->type;
} else {
type = ref->type.getHeapType().getStruct().fields[index].type;
}
Expand Down Expand Up @@ -1382,9 +1380,7 @@ void ArrayCmpxchg::finalize() {
replacement->type == Type::unreachable) {
type = Type::unreachable;
} else if (ref->type.isNull()) {
// Like ArrayRMW, but the most precise possible field type is the LUB of
// the expected and replacement values.
type = Type::getLeastUpperBound(expected->type, replacement->type);
type = replacement->type;
} else {
type = ref->type.getHeapType().getArray().element.type;
}
Expand Down