aboutsummaryrefslogtreecommitdiff
path: root/src/stage1/analyze.cpp
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-11-11 10:11:25 +0100
committerVeikka Tuominen <git@vexu.eu>2020-11-11 13:53:24 +0200
commitf0b1b74d214169a72cf5ae28d88637f20100bcad (patch)
treead32cf812fc0c682df365e35bcaa3cb9e0a4b046 /src/stage1/analyze.cpp
parent8b9195282e99427964119431b6f4e535eeb4d9ba (diff)
downloadzig-f0b1b74d214169a72cf5ae28d88637f20100bcad.tar.gz
zig-f0b1b74d214169a72cf5ae28d88637f20100bcad.zip
stage1: Avoid resolving type entry in [0]T
The logic was already there but this rule was only applied in some places, apply it in the remaining code paths. Closes #7058
Diffstat (limited to 'src/stage1/analyze.cpp')
-rw-r--r--src/stage1/analyze.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/stage1/analyze.cpp b/src/stage1/analyze.cpp
index 2fe4410027..9e0c0d5df8 100644
--- a/src/stage1/analyze.cpp
+++ b/src/stage1/analyze.cpp
@@ -1453,7 +1453,12 @@ Error type_val_resolve_abi_align(CodeGen *g, AstNode *source_node, ZigValue *typ
case LazyValueIdArrayType: {
LazyValueArrayType *lazy_array_type =
reinterpret_cast<LazyValueArrayType *>(type_val->data.x_lazy);
- return type_val_resolve_abi_align(g, source_node, lazy_array_type->elem_type->value, abi_align);
+
+ if (lazy_array_type->length + (lazy_array_type->sentinel != nullptr) != 0)
+ return type_val_resolve_abi_align(g, source_node, lazy_array_type->elem_type->value, abi_align);
+
+ *abi_align = 0;
+ return ErrorNone;
}
case LazyValueIdErrUnionType: {
LazyValueErrUnionType *lazy_err_union_type =