From 45937306321df28266c793b7225eb10ad3d741e2 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 22 Dec 2019 11:40:30 +0000 Subject: [PATCH] Fix Trying to get a pointer to a struct field that does not have a size generates an LLVM error #509 --- src/ir_print.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ir_print.cpp b/src/ir_print.cpp index 201c9d1d6..35116fb69 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -442,12 +442,13 @@ void ir_print_type(irFileBuffer *f, irModule *m, Type *t, bool in_struct) { break; case Type_Pointer: - if (!is_type_named(t->Pointer.elem) && is_type_empty_struct(t->Pointer.elem)) { - ir_print_type(f, m, t_rawptr); - } else { + // TODO(bill, 2019-12-22): Why did I make add this edge case? Is this some weird LLVM issue? + // if (!is_type_named(t->Pointer.elem) && is_type_empty_struct(t->Pointer.elem)) { + // ir_print_type(f, m, t_rawptr); + // } else { ir_print_type(f, m, t->Pointer.elem); ir_write_byte(f, '*'); - } + // } return; case Type_Array: ir_write_byte(f, '[');