| author | |
| committer | |
| log | cbfe9a407776d3b56a4da2a3bc3108a2f31b9212 |
| tree | dac4fc6b2d43db5ea2295e16b37a885dac009f97 |
| parent | 6394f7e9a3f0d6db58287dee96af3cb9fae8ee8a |
closes #12572 files changed, 11 insertions(+), 0 deletions(-)
src/ir.cpp+1| ... | ... | @@ -13092,6 +13092,7 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal |
| 13092 | 13092 | impl_fn->ir_executable.parent_exec = ira->new_irb.exec; |
| 13093 | 13093 | impl_fn->analyzed_executable.source_node = call_instruction->base.source_node; |
| 13094 | 13094 | impl_fn->analyzed_executable.parent_exec = ira->new_irb.exec; |
| 13095 | impl_fn->analyzed_executable.backward_branch_quota = ira->new_irb.exec->backward_branch_quota; | |
| 13095 | 13096 | impl_fn->analyzed_executable.is_generic_instantiation = true; |
| 13096 | 13097 | |
| 13097 | 13098 | ira->codegen->fn_defs.append(impl_fn); |
test/cases/eval.zig+10| ... | ... | @@ -642,3 +642,13 @@ test "@tagName of @typeId" { |
| 642 | 642 | const str = @tagName(@typeId(u8)); |
| 643 | 643 | assert(std.mem.eql(u8, str, "Int")); |
| 644 | 644 | } |
| 645 | ||
| 646 | test "setting backward branch quota just before a generic fn call" { | |
| 647 | @setEvalBranchQuota(1001); | |
| 648 | loopNTimes(1001); | |
| 649 | } | |
| 650 | ||
| 651 | fn loopNTimes(comptime n: usize) void { | |
| 652 | comptime var i = 0; | |
| 653 | inline while (i < n) : (i += 1) {} | |
| 654 | } |