From 6cfe21094bb519c759223992bff66942ce6eb920 Mon Sep 17 00:00:00 2001 From: jbrodman Date: Mon, 3 Nov 2014 06:14:47 -0800 Subject: [PATCH] Fix nested structs being expanded in headers --- module.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module.cpp b/module.cpp index a20d2297..2e25fde4 100644 --- a/module.cpp +++ b/module.cpp @@ -1436,7 +1436,8 @@ lEmitStructDecl(const StructType *st, std::vector *emittedSt for (int i = 0; i < st->GetElementCount(); ++i) { const Type *type = st->GetElementType(i)->GetAsNonConstType(); std::string d = type->GetCDeclaration(st->GetElementName(i)); - if (type->IsVaryingType()) { + // Don't expand struct members as their insides will be expanded. + if (type->IsVaryingType() && (CastType(type) == NULL)) { fprintf(file, " %s[%d];\n", d.c_str(), g->target->getVectorWidth()); } else {