aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-10-13 11:07:39 -0400
committerGitHub <noreply@github.com>2019-10-13 11:07:39 -0400
commit9439bf3809de68a30a73451cc7648a266aba0a36 (patch)
tree254924500bbeae4756df98d67b54eb454030c391 /src/analyze.cpp
parentae0628b30cdde8068dbefcbe6827f3339a9da088 (diff)
parent22e60df68024f3fd72c91ec7b17dbf7abc71c86c (diff)
downloadzig-9439bf3809de68a30a73451cc7648a266aba0a36.tar.gz
zig-9439bf3809de68a30a73451cc7648a266aba0a36.zip
Merge pull request #3446 from LemonBoy/riscv-things-x
More RISC-V stuff
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index a38766bc25..399966d041 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -1787,6 +1787,7 @@ static ZigType *analyze_fn_type(CodeGen *g, AstNode *proto_node, Scope *child_sc
if (!analyze_const_align(g, child_scope, fn_proto->align_expr, &fn_type_id.alignment)) {
return g->builtin_types.entry_invalid;
}
+ fn_entry->align_bytes = fn_type_id.alignment;
}
if (fn_proto->return_var_token != nullptr) {
@@ -3327,7 +3328,9 @@ static void resolve_decl_fn(CodeGen *g, TldFn *tld_fn) {
fn_table_entry->type_entry = analyze_fn_type(g, source_node, child_scope, fn_table_entry);
if (fn_proto->section_expr != nullptr) {
- analyze_const_string(g, child_scope, fn_proto->section_expr, &fn_table_entry->section_name);
+ if (!analyze_const_string(g, child_scope, fn_proto->section_expr, &fn_table_entry->section_name)) {
+ fn_table_entry->type_entry = g->builtin_types.entry_invalid;
+ }
}
if (fn_table_entry->type_entry->id == ZigTypeIdInvalid) {