From 663e665843627cead40258a74ffddf4574fbb816 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Wed, 18 Sep 2019 08:54:59 +0200 Subject: Prevent crash with invalid extern type Fixes #3240 --- src/analyze.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/analyze.cpp') diff --git a/src/analyze.cpp b/src/analyze.cpp index f46abe5e52..5a3551a7c2 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -1606,6 +1606,10 @@ Error type_allowed_in_extern(CodeGen *g, ZigType *type_entry, bool *result) { *result = false; return ErrorNone; } + if (!type_is_nonnull_ptr(child_type)) { + *result = false; + return ErrorNone; + } return type_allowed_in_extern(g, child_type, result); } case ZigTypeIdEnum: -- cgit v1.2.3