瀏覽代碼

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 年之前
父節點
當前提交
d87a18e4a2
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/AzslcSymbolAggregator.cpp

+ 1 - 1
src/AzslcSymbolAggregator.cpp

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