Skip to content

Commit 4aec232

Browse files
My changes
1 parent 5f437b9 commit 4aec232

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

src/parser/parsers.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ Result<> makeNop(Ctx&, Index, const std::vector<Annotation>&);
9191
template<typename Ctx>
9292
Result<> makeBinary(Ctx&, Index, const std::vector<Annotation>&, BinaryOp op);
9393
template<typename Ctx>
94-
Result<>
95-
makeWideIntAddSub(Ctx&, Index, const std::vector<Annotation>&, WideIntAddSubOp op);
96-
94+
Result<> makeWideIntAddSub(Ctx&,
95+
Index,
96+
const std::vector<Annotation>&,
97+
WideIntAddSubOp op);
9798
template<typename Ctx>
9899
Result<> makeUnary(Ctx&, Index, const std::vector<Annotation>&, UnaryOp op);
99100
template<typename Ctx>

src/wasm/wasm-binary.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4002,7 +4002,6 @@ Result<> WasmBinaryReader::readInst() {
40024002
return builder.makeWideIntAddSub(AddInt128);
40034003
case BinaryConsts::I64Sub128:
40044004
return builder.makeWideIntAddSub(SubInt128);
4005-
40064005
case BinaryConsts::TableSize:
40074006
return builder.makeTableSize(getTableName(getU32LEB()));
40084007
case BinaryConsts::TableGrow:

src/wasm/wasm-validator.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -937,18 +937,16 @@ void FunctionValidator::validatePoppyBlockElements(Block* curr) {
937937

938938
void FunctionValidator::visitLoop(Loop* curr) {
939939
if (curr->name.is()) {
940-
auto noteLabelName = [&](Name name) {
941-
auto iter = breakTypes.find(name);
942-
assert(iter != breakTypes.end()); // we set it ourselves
943-
for (Type breakType : iter->second) {
944-
shouldBeEqual(breakType,
945-
Type(Type::none),
946-
curr,
947-
"breaks to a loop cannot pass a value");
948-
}
949-
breakTypes.erase(iter);
950-
};
951940
noteLabelName(curr->name);
941+
auto iter = breakTypes.find(curr->name);
942+
assert(iter != breakTypes.end()); // we set it ourselves
943+
for (Type breakType : iter->second) {
944+
shouldBeEqual(breakType,
945+
Type(Type::none),
946+
curr,
947+
"breaks to a loop cannot pass a value");
948+
}
949+
breakTypes.erase(iter);
952950
}
953951
if (curr->type == Type::none) {
954952
shouldBeFalse(curr->body->type.isConcrete(),
@@ -2450,15 +2448,17 @@ void FunctionValidator::visitWideIntAddSub(WideIntAddSub* curr) {
24502448
"Wide arithmetic is not enabled")) {
24512449
return;
24522450
}
2453-
for (auto* operand : {curr->leftLow, curr->leftHigh, curr->rightLow, curr->rightHigh}) {
2451+
for (auto* operand :
2452+
{curr->leftLow, curr->leftHigh, curr->rightLow, curr->rightHigh}) {
24542453
if (operand->type != Type::unreachable) {
2455-
shouldBeEqual(
2456-
operand->type, Type(Type::i64), curr, "wide binary child types must be i64");
2454+
shouldBeEqual(operand->type,
2455+
Type(Type::i64),
2456+
curr,
2457+
"wide binary child types must be i64");
24572458
}
24582459
}
24592460
}
24602461

2461-
24622462
void FunctionValidator::visitDrop(Drop* curr) {
24632463
shouldBeTrue(curr->value->type.isConcrete() ||
24642464
curr->value->type == Type::unreachable,

0 commit comments

Comments
 (0)