Skip to content
Merged
Changes from 1 commit
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
Next Next commit
fix
  • Loading branch information
kripken committed Apr 1, 2026
commit cfb335064d5cb153030849f4bf7df7d6194723a3
10 changes: 6 additions & 4 deletions src/ir/possible-contents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3136,31 +3136,33 @@ void Flower::filterPackedDataReads(PossibleContents& contents,
Expression* ref;
Index index;
unsigned bytes = 0;
Type resultType = Type::none;
if (auto* get = expr->dynCast<StructGet>()) {
signed_ = get->signed_;
ref = get->ref;
index = get->index;
resultType = get->type;
} else if (auto* get = expr->dynCast<ArrayGet>()) {
signed_ = get->signed_;
ref = get->ref;
// Arrays are treated as having a single field.
index = 0;
resultType = get->type;
} else if (auto* load = expr->dynCast<ArrayLoad>()) {
signed_ = load->signed_;
ref = load->ref;
index = 0;
bytes = load->bytes;
resultType = load->type;
} else {
WASM_UNREACHABLE("bad packed read");
}
if (!signed_) {
return;
}

Type resultType = expr->type;
if (resultType == Type::unreachable) {
// This read never executes.
return;
}

// If there is no struct or array to read, no value will ever be returned.
if (ref->type.isNull()) {
contents = PossibleContents::none();
Expand Down