| ... | @@ -599,8 +599,8 @@ fn zirSetEvalBranchQuota( | ... | @@ -599,8 +599,8 @@ fn zirSetEvalBranchQuota( |
| 599 | const src = inst_data.src(); | 599 | const src = inst_data.src(); |
| 600 | try sema.requireFunctionBlock(block, src); | 600 | try sema.requireFunctionBlock(block, src); |
| 601 | const quota = try sema.resolveAlreadyCoercedInt(block, src, inst_data.operand, u32); | 601 | const quota = try sema.resolveAlreadyCoercedInt(block, src, inst_data.operand, u32); |
| 602 | if (b.branch_quota.* < quota) | 602 | if (sema.branch_quota < quota) |
| 603 | b.branch_quota.* = quota; | 603 | sema.branch_quota = quota; |
| 604 | return sema.mod.constVoid(block.arena, .unneeded); | 604 | return sema.mod.constVoid(block.arena, .unneeded); |
| 605 | } | 605 | } |
| 606 | | 606 | |
| ... | @@ -2960,11 +2960,9 @@ fn safetyPanic(sema: *Sema, block: *Scope.Block, src: LazySrcLoc, panic_id: Pani | ... | @@ -2960,11 +2960,9 @@ fn safetyPanic(sema: *Sema, block: *Scope.Block, src: LazySrcLoc, panic_id: Pani |
| 2960 | fn emitBackwardBranch(sema: *Sema, block: *Scope.Block, src: LazySrcLoc) !void { | 2960 | fn emitBackwardBranch(sema: *Sema, block: *Scope.Block, src: LazySrcLoc) !void { |
| 2961 | const shared = block.inlining.?.shared; | 2961 | const shared = block.inlining.?.shared; |
| 2962 | shared.branch_count += 1; | 2962 | shared.branch_count += 1; |
| 2963 | if (shared.branch_count > block.branch_quota.*) { | 2963 | if (shared.branch_count > sema.branch_quota) { |
| 2964 | // TODO show the "called from here" stack | 2964 | // TODO show the "called from here" stack |
| 2965 | return mod.fail(&block.base, src, "evaluation exceeded {d} backwards branches", .{ | 2965 | return sema.mod.fail(&block.base, src, "evaluation exceeded {d} backwards branches", .{sema.branch_quota}); |
| 2966 | block.branch_quota.*, | | |
| 2967 | }); | | |
| 2968 | } | 2966 | } |
| 2969 | } | 2967 | } |
| 2970 | | 2968 | |