From e8f44d426c0871069eeafa35bedde64498c4d825 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 12 Mar 2018 10:26:17 -0700 Subject: Don't use specialized field names when legalizing types The type legalization logic currently looks up layout information for the fields of an aggregate type using the mangled name of the field (since this should be consistent even when legalization changes the number of fields). The problem at present is that type layouts for specialized generic types were storing the mangled names of *specialized* field decl-refs, while the lookup was using the mangled names of the unspecialized declarations. The latter (unspecialized names) is what we want for simplicity, so this change fixes the comparison. --- source/slang/legalize-types.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/slang/legalize-types.cpp b/source/slang/legalize-types.cpp index c90b12558..0b8f49b0c 100644 --- a/source/slang/legalize-types.cpp +++ b/source/slang/legalize-types.cpp @@ -1016,7 +1016,7 @@ RefPtr getFieldLayout( { for(auto ff : structTypeLayout->fields) { - if(mangledFieldName == getMangledName(ff->varDecl) ) + if(mangledFieldName == getMangledName(ff->varDecl.getDecl()) ) { return ff; } -- cgit v1.2.3