diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-04-07 00:33:19 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-04-07 00:33:19 -0400 |
| commit | ffb4852012509327c646c9899259e894965b2259 (patch) | |
| tree | c187efa334e090db5ff389b2e76a6dea33d3ffd6 /src/ir.cpp | |
| parent | a3de550d3bf020fd68e1331d3cb8b7b422894f96 (diff) | |
| download | zig-ffb4852012509327c646c9899259e894965b2259.tar.gz zig-ffb4852012509327c646c9899259e894965b2259.zip | |
add compile error for the bug of unable to call var ags at compile time
See #313
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index c7c9c6490c..1176ac2845 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -8252,6 +8252,13 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal return ira->codegen->builtin_types.entry_invalid; } + if (fn_proto_node->data.fn_proto.is_var_args) { + ir_add_error(ira, &call_instruction->base, + buf_sprintf("compiler bug: unable to call var args function at compile time. https://github.com/andrewrk/zig/issues/313")); + return ira->codegen->builtin_types.entry_invalid; + } + + for (size_t call_i = 0; call_i < call_instruction->arg_count; call_i += 1) { IrInstruction *old_arg = call_instruction->args[call_i]->other; if (type_is_invalid(old_arg->value.type)) |
