| ... | ... | @@ -1249,13 +1249,17 @@ fn parseLabeledStatement(p: *Parse) !?Node.Index { |
| 1249 | 1249 | const label_token = opt_label_token orelse return null; |
| 1250 | 1250 | |
| 1251 | 1251 | const after_colon = p.tok_i; |
| 1252 | | if (try p.parseTypeExpr()) |_| { |
| 1253 | | const a = try p.parseByteAlign(); |
| 1254 | | const b = try p.parseAddrSpace(); |
| 1255 | | const c = try p.parseLinkSection(); |
| 1256 | | const d = if (p.eatToken(.equal) == null) null else try p.expectExpr(); |
| 1257 | | if (a != null or b != null or c != null or d != null) { |
| 1258 | | return p.failMsg(.{ .tag = .expected_var_const, .token = label_token }); |
| 1252 | // Don't bother trying to give a better error message if recovery is disabled. |
| 1253 | // This avoids a possible stack overflow in e.g. parseTypeExpr() when fuzzing. |
| 1254 | if (p.recover) { |
| 1255 | if (try p.parseTypeExpr()) |_| { |
| 1256 | const a = try p.parseByteAlign(); |
| 1257 | const b = try p.parseAddrSpace(); |
| 1258 | const c = try p.parseLinkSection(); |
| 1259 | const d = if (p.eatToken(.equal) == null) null else try p.expectExpr(); |
| 1260 | if (a != null or b != null or c != null or d != null) { |
| 1261 | return p.failMsg(.{ .tag = .expected_var_const, .token = label_token }); |
| 1262 | } |
| 1259 | 1263 | } |
| 1260 | 1264 | } |
| 1261 | 1265 | return p.failMsg(.{ .tag = .expected_labelable, .token = after_colon }); |