From 720302a6407e954ffccf65f38ad40b47868627ce Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 25 Aug 2019 21:28:16 -0400 Subject: fix resolution detection of pointer types --- src/analyze.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/analyze.cpp') diff --git a/src/analyze.cpp b/src/analyze.cpp index 2ee0322db1..181cab2332 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -289,13 +289,26 @@ bool type_is_resolved(ZigType *type_entry, ResolveStatus status) { } case ZigTypeIdOpaque: return status < ResolveStatusSizeKnown; + case ZigTypeIdPointer: + switch (status) { + case ResolveStatusInvalid: + zig_unreachable(); + case ResolveStatusUnstarted: + return true; + case ResolveStatusZeroBitsKnown: + case ResolveStatusAlignmentKnown: + case ResolveStatusSizeKnown: + return type_entry->abi_size != SIZE_MAX; + case ResolveStatusLLVMFwdDecl: + case ResolveStatusLLVMFull: + return type_entry->llvm_type != nullptr; + } case ZigTypeIdMetaType: case ZigTypeIdVoid: case ZigTypeIdBool: case ZigTypeIdUnreachable: case ZigTypeIdInt: case ZigTypeIdFloat: - case ZigTypeIdPointer: case ZigTypeIdArray: case ZigTypeIdComptimeFloat: case ZigTypeIdComptimeInt: -- cgit v1.2.3