aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-11-25 18:46:35 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-11-25 18:46:35 -0500
commit80f79cc9e8ed02f631c9d59f68e5f20a909e85fc (patch)
treeba8da3ef0611a547fe67c61ed2d42d4ea67e6d2e /src/ir.cpp
parentcb38bd0a1436bd18de8ed57c45ffc890c8ddfb78 (diff)
parent4261fa3c49be715355c9623102bad0bf93d537a3 (diff)
downloadzig-80f79cc9e8ed02f631c9d59f68e5f20a909e85fc.tar.gz
zig-80f79cc9e8ed02f631c9d59f68e5f20a909e85fc.zip
Merge branch 'fengb-wasi-run-tests'
closes #3730
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index f4bcfb6330..7e867f1c93 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -17095,6 +17095,14 @@ static IrInstruction *analyze_casted_new_stack(IrAnalyze *ira, IrInstructionCall
if (call_instruction->new_stack == nullptr)
return nullptr;
+ if (!call_instruction->is_async_call_builtin &&
+ arch_stack_pointer_register_name(ira->codegen->zig_target->arch) == nullptr)
+ {
+ ir_add_error(ira, &call_instruction->base,
+ buf_sprintf("target arch '%s' does not support @newStackCall",
+ target_arch_name(ira->codegen->zig_target->arch)));
+ }
+
IrInstruction *new_stack = call_instruction->new_stack->child;
if (type_is_invalid(new_stack->value->type))
return ira->codegen->invalid_instruction;