From 84e32db622892b236ba62ed7b6de29bb3b0653ec Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 27 Aug 2015 15:40:46 -0500 Subject: [PATCH] LLVMIRGenerator: handle self-referential class types. --- artiq/compiler/transforms/llvm_ir_generator.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/artiq/compiler/transforms/llvm_ir_generator.py b/artiq/compiler/transforms/llvm_ir_generator.py index 140a0351a..5fe65363b 100644 --- a/artiq/compiler/transforms/llvm_ir_generator.py +++ b/artiq/compiler/transforms/llvm_ir_generator.py @@ -270,6 +270,9 @@ class LLVMIRGenerator: llty = self.llcontext.get_identified_type(name) if llty.elements is None: + # First setting elements to [] will allow us to handle + # self-referential types. + llty.elements = [] llty.elements = [self.llty_of_type(attrtyp) for attrtyp in typ.attributes.values()]