diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-02-05 01:57:49 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-02-05 01:57:49 -0500 |
| commit | d2f1f57fa410b781f17ab7b04311af50ff775070 (patch) | |
| tree | 8c2bd88bbd0f1930259948d2cbde776df57d8aeb | |
| parent | 74d41ce44ba964bea171e964a1e4a1bab8edc8c0 (diff) | |
| download | zig-d2f1f57fa410b781f17ab7b04311af50ff775070.tar.gz zig-d2f1f57fa410b781f17ab7b04311af50ff775070.zip | |
even external functions which provide definitions get nounwind
| -rw-r--r-- | src/codegen.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index 3328bc3de4..f19f6bb8bf 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -268,7 +268,7 @@ static LLVMValueRef fn_llvm_value(CodeGen *g, FnTableEntry *fn_table_entry) { LLVMAddFunctionAttr(fn_table_entry->llvm_value, LLVMNoReturnAttribute); } LLVMSetFunctionCallConv(fn_table_entry->llvm_value, fn_type->data.fn.calling_convention); - if (!fn_type->data.fn.fn_type_id.is_extern) { + if (!fn_type->data.fn.fn_type_id.is_extern || fn_table_entry->fn_def_node != nullptr) { LLVMAddFunctionAttr(fn_table_entry->llvm_value, LLVMNoUnwindAttribute); } if (!g->is_release_build && fn_table_entry->fn_inline != FnInlineAlways) { |
