Kaynağa Gözat

fix a bug that creates an infinite loop if we kick a lookup from an intrinsic type.
For instance "?Texture2D" as scope, and "Load" as method will end up in a "LevelUp" that isn't "/" but is "". The empty path was never never meant to be a possible output of LevelUp function, but it does happen in case of levelup from non rooted symbols.

Signed-off-by: Vivien Oddou <[email protected]>

Vivien Oddou 2 yıl önce
ebeveyn
işleme
d87a18e4a2
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      src/AzslcSymbolAggregator.cpp

+ 1 - 1
src/AzslcSymbolAggregator.cpp

@@ -140,7 +140,7 @@ namespace AZ::ShaderCompiler
         {
             auto attempt = QualifiedName{JoinPath(path, name)};
             got = GetIdAndKindInfo(attempt);
-            exit = path == "/";
+            exit = path == "/" || path.empty();
             if (!got)
             {
                 if (auto* scopeAsClass = GetAsSub<ClassInfo>(IdentifierUID{GetParentName(attempt)})) // get enclosing class