@@ -937,18 +937,16 @@ void FunctionValidator::validatePoppyBlockElements(Block* curr) {
937937
938938void 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-
24622462void FunctionValidator::visitDrop (Drop* curr) {
24632463 shouldBeTrue (curr->value ->type .isConcrete () ||
24642464 curr->value ->type == Type::unreachable,
0 commit comments