aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-01-25 22:20:52 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-01-25 22:20:52 -0700
commit01428d4a72c8013e1fe8cfc69eedeb843b1d75c8 (patch)
tree99698ddc6f5bc22f660e9669c094a3933f34d856 /src/analyze.cpp
parenta3e288ab5be1008dafa86b47c18ebf480cc9d6a7 (diff)
downloadzig-01428d4a72c8013e1fe8cfc69eedeb843b1d75c8.tar.gz
zig-01428d4a72c8013e1fe8cfc69eedeb843b1d75c8.zip
analyze: fix crash when return type is invalid
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 31fa9c68c2..27bda281c3 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -3466,6 +3466,10 @@ static TypeTableEntry *analyze_fn_call_raw(CodeGen *g, ImportTableEntry *import,
TypeTableEntry *return_type = unwrapped_node_type(fn_proto->return_type);
+ if (return_type->id == TypeTableEntryIdInvalid) {
+ return return_type;
+ }
+
if (handle_is_ptr(return_type)) {
context->cast_alloca_list.append(node);
}