aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-03-10 11:30:30 -0500
committerAndrew Kelley <superjoe30@gmail.com>2017-03-10 11:30:30 -0500
commit7bc0145b802002c38a409dd9fe0b297c8af82391 (patch)
treee3d78bf0ecbff72b42e601c75e1ec205d93815a9 /src/analyze.cpp
parent434f017aeefc392bcf524732940e2f2b908222f3 (diff)
downloadzig-7bc0145b802002c38a409dd9fe0b297c8af82391.tar.gz
zig-7bc0145b802002c38a409dd9fe0b297c8af82391.zip
types with zero bits do not have a pointer handle
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 870f06dfe8..4f806b9e1b 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -2954,14 +2954,14 @@ bool handle_is_ptr(TypeTableEntry *type_entry) {
case TypeTableEntryIdArray:
case TypeTableEntryIdStruct:
case TypeTableEntryIdUnion:
- return true;
+ return type_has_bits(type_entry);
case TypeTableEntryIdErrorUnion:
return type_has_bits(type_entry->data.error.child_type);
case TypeTableEntryIdEnum:
assert(type_entry->data.enumeration.complete);
return type_entry->data.enumeration.gen_field_count != 0;
case TypeTableEntryIdMaybe:
- return !type_entry->data.maybe.child_type->zero_bits &&
+ return type_has_bits(type_entry->data.maybe.child_type) &&
type_entry->data.maybe.child_type->id != TypeTableEntryIdPointer &&
type_entry->data.maybe.child_type->id != TypeTableEntryIdFn;
case TypeTableEntryIdTypeDecl: