aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-04-10 20:46:32 +0100
committergingerBill <bill@gingerbill.org>2018-04-10 20:46:32 +0100
commite71a6413799577b2e422026003cfcd0fac72c7c7 (patch)
treec242edc3d1c1cd7d12c1687b8b3f82f32b813527 /src/types.cpp
parente2eca45188bc05cc11fe7934e55fe63e27165974 (diff)
Fix internal compiler error trigger for issue #212
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp
index d3029cd6c..e74aa88af 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -1201,6 +1201,10 @@ bool type_has_nil(Type *t) {
}
bool elem_type_can_be_constant(Type *t) {
+ t = base_type(t);
+ if (t == t_invalid) {
+ return false;
+ }
if (is_type_any(t) || is_type_union(t)) {
return false;
}