Skip to content
Merged
Show file tree
Hide file tree
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
Prev Previous commit
oops
  • Loading branch information
ashleynh committed Feb 28, 2024
commit ed481b517d0e601d94a9235fdc8a1ee2b3b5ee5e
2 changes: 1 addition & 1 deletion src/passes/Outlining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ struct ReconstructStringifyWalker
// Assert ensures new unhandled branch instructions
// will quickly cause an error. Serves as a reminder to
// implement a new special-case visit*WithType.
assert(curr->is<BrOn> || !Properties::isBranch(curr));
assert(curr->is<BrOn>() || !Properties::isBranch(curr));
ASSERT_OK(builder->visit(curr));
Copy link
Member

Choose a reason for hiding this comment

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

It would be good to add an assertion somewhere to future-proof ourselves against the possibility that a new kind of Expression starts to need a visit*WithType variant. This could either be an assert(!Properties::isBranch(curr)) here guarding the default builder->visit(curr) case, or it could be an assertion that curr is a Break or Switch inside IRBuilder::getBranchValue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

}
}
Expand Down
4 changes: 2 additions & 2 deletions src/wasm/wasm-ir-builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ Result<> IRBuilder::visitBreakWithType(Break* curr, Type type) {
CHECK_ERR(cond);
curr->condition = *cond;
}
if (type == Type::None) {
if (type == Type::none) {
curr->value = nullptr;
} else {
auto value = pop(type.size());
Expand All @@ -470,7 +470,7 @@ Result<> IRBuilder::visitSwitchWithType(Switch* curr, Type type) {
auto cond = pop();
CHECK_ERR(cond);
curr->condition = *cond;
if (type == Type::None) {
if (type == Type::none) {
curr->value = nullptr;
} else {
auto value = pop(type.size());
Expand Down