From 0a82611174e0e1b290702ad57301f873e883f519 Mon Sep 17 00:00:00 2001 From: Sebastian Tafuri Date: Fri, 6 Oct 2017 22:45:00 +0200 Subject: [PATCH] Only track variables in the global scope --- hlsl/hlslParseHelper.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp index 615776c1..58eb64c9 100755 --- a/hlsl/hlslParseHelper.cpp +++ b/hlsl/hlslParseHelper.cpp @@ -8289,8 +8289,11 @@ void HlslParseContext::declareBlock(const TSourceLoc& loc, TType& type, const TS return; } - // Save it in the AST for linker use. - trackLinkage(variable); + if(symbolTable.atGlobalLevel()) + { + // Save it in the AST for linker use. + trackLinkage(variable); + } } //