diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-03-12 00:08:52 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-03-12 00:08:52 -0400 |
| commit | 49c3922037ef0b913466e707d85a4e085f6e9716 (patch) | |
| tree | 58904795206468e87acd5ad3dc9c491111d076f6 /src/ir.cpp | |
| parent | c18059a3ddcaec1bef18180ec797fe41baeac7f3 (diff) | |
| download | zig-49c3922037ef0b913466e707d85a4e085f6e9716.tar.gz zig-49c3922037ef0b913466e707d85a4e085f6e9716.zip | |
fix incorrect setEvalBranchQuota compile error
closes #688
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 8fa6d5c44f..69b955aef7 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -12127,6 +12127,7 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal impl_fn->ir_executable.parent_exec = ira->new_irb.exec; impl_fn->analyzed_executable.source_node = call_instruction->base.source_node; impl_fn->analyzed_executable.parent_exec = ira->new_irb.exec; + impl_fn->analyzed_executable.is_generic_instantiation = true; ira->codegen->fn_defs.append(impl_fn); } @@ -15234,7 +15235,7 @@ static TypeTableEntry *ir_analyze_instruction_type_id(IrAnalyze *ira, static TypeTableEntry *ir_analyze_instruction_set_eval_branch_quota(IrAnalyze *ira, IrInstructionSetEvalBranchQuota *instruction) { - if (ira->new_irb.exec->parent_exec != nullptr) { + if (ira->new_irb.exec->parent_exec != nullptr && !ira->new_irb.exec->is_generic_instantiation) { ir_add_error(ira, &instruction->base, buf_sprintf("@setEvalBranchQuota must be called from the top of the comptime stack")); return ira->codegen->builtin_types.entry_invalid; |
