diff options
| author | LemonBoy <thatlemon@gmail.com> | 2019-09-18 08:54:59 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-09-23 17:30:28 -0400 |
| commit | 663e665843627cead40258a74ffddf4574fbb816 (patch) | |
| tree | adb2f8bb7a31a7a0fd7903a7f71485f4056a0c86 /src/analyze.cpp | |
| parent | db988f42a7ac1ce0ec65fde0e7ea94009b1d7238 (diff) | |
| download | zig-663e665843627cead40258a74ffddf4574fbb816.tar.gz zig-663e665843627cead40258a74ffddf4574fbb816.zip | |
Prevent crash with invalid extern type
Fixes #3240
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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: |
