diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-01-18 19:25:23 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-18 19:25:23 -0500 |
| commit | 7bb4c855ad3776d7f7d21f2bf1c5c93366205ff2 (patch) | |
| tree | 1695efe0e849848743d3c152f4349b054a7bf96e /src/analyze.cpp | |
| parent | 405b8e9eeefda07b16044690471cfd57fc654c75 (diff) | |
| parent | b0f753e21d6fcaafd0b35dc02fdfe23b14e310d6 (diff) | |
| download | zig-7bb4c855ad3776d7f7d21f2bf1c5c93366205ff2.tar.gz zig-7bb4c855ad3776d7f7d21f2bf1c5c93366205ff2.zip | |
Merge pull request #4222 from LemonBoy/eutwouwth
Prevent crash with empty non-exhaustive enum
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index e064677a09..0bbec66a9b 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -8312,7 +8312,7 @@ static void resolve_llvm_types_enum(CodeGen *g, ZigType *enum_type, ResolveStatu uint32_t field_count = enum_type->data.enumeration.src_field_count; - assert(enum_type->data.enumeration.fields); + assert(field_count == 0 || enum_type->data.enumeration.fields != nullptr); ZigLLVMDIEnumerator **di_enumerators = allocate<ZigLLVMDIEnumerator*>(field_count); for (uint32_t i = 0; i < field_count; i += 1) { |
