aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-02-29 01:05:11 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-02-29 01:05:11 -0500
commit3cba603eae1a1c8b0338f5584041c73d55682c0a (patch)
treeeaf747f253634521294e49b0ad5bf175af216771 /src/analyze.cpp
parent1aef0bef754ddf1943e22740ef045fab7769cde1 (diff)
downloadzig-3cba603eae1a1c8b0338f5584041c73d55682c0a.tar.gz
zig-3cba603eae1a1c8b0338f5584041c73d55682c0a.zip
fix crash when building docgen
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 90037a1191..1a9172c030 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -6734,8 +6734,6 @@ static bool const_values_equal_array(CodeGen *g, ZigValue *a, ZigValue *b, size_
bool const_values_equal(CodeGen *g, ZigValue *a, ZigValue *b) {
if (a->type->id != b->type->id) return false;
- assert(a->special == ConstValSpecialStatic);
- assert(b->special == ConstValSpecialStatic);
if (a->type == b->type) {
switch (type_has_one_possible_value(g, a->type)) {
case OnePossibleValueInvalid:
@@ -6746,6 +6744,11 @@ bool const_values_equal(CodeGen *g, ZigValue *a, ZigValue *b) {
return true;
}
}
+ if (a->special == ConstValSpecialUndef || b->special == ConstValSpecialUndef) {
+ return a->special == b->special;
+ }
+ assert(a->special == ConstValSpecialStatic);
+ assert(b->special == ConstValSpecialStatic);
switch (a->type->id) {
case ZigTypeIdOpaque:
zig_unreachable();