commit 0d1ce1fb5fb4bcfff0dc24b567220af6ec6b93ab (tree)
parent c968d8756c9158433a9fb30db1f4989d1148cc7f
Author: kristopher tate <kris.tate+github@gmail.com>
Date: Sun, 20 Jan 2019 16:57:13 +0900
src/analyze.cpp: return type entry for `ZigTypeIdPointer` if it points to `ZigTypeIdOpaque`
ref: ziglang/zig#1883
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/analyze.cpp b/src/analyze.cpp
@@ -5751,6 +5751,13 @@ void eval_min_max_value(CodeGen *g, ZigType *type_entry, ConstExprValue *const_v
}
void render_const_val_ptr(CodeGen *g, Buf *buf, ConstExprValue *const_val, ZigType *type_entry) {
+ assert(type_entry->id == ZigTypeIdPointer);
+
+ if (type_entry->data.pointer.child_type->id == ZigTypeIdOpaque) {
+ buf_append_buf(buf, &type_entry->name);
+ return;
+ }
+
switch (const_val->data.x_ptr.special) {
case ConstPtrSpecialInvalid:
zig_unreachable();