diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-08-25 21:28:16 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-08-25 21:28:16 -0400 |
| commit | 720302a6407e954ffccf65f38ad40b47868627ce (patch) | |
| tree | 959b2b287fad50c77b5a5bbee121d2dd1fad5796 /src/analyze.cpp | |
| parent | a7f31581850fe2811bc5114459a8d193dd48b42a (diff) | |
| download | zig-720302a6407e954ffccf65f38ad40b47868627ce.tar.gz zig-720302a6407e954ffccf65f38ad40b47868627ce.zip | |
fix resolution detection of pointer types
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
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: |
