Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

illegal iterator comparison in EnableBlockExpansion argument finder #19

Open
ArseniyKorobenko opened this issue Dec 5, 2024 · 0 comments

Comments

@ArseniyKorobenko
Copy link

Итератор, возвращаемый FindKernelByName() может принадлежать одной из трёх разных таблиц, в связи с чем его сравнение с end() чужой таблицы нелегально и в моём случае бросает исключение.

компилятор: MSVC

Предлагаемое исправление:

template_rendering_host.cpp:1379

@@ -1376,13 +1376,12 @@ template_rendering_host.cpp kslicer::PrepareJsonForAllCPP(const MainClassInfo& a_classInfo, ...)
       const auto pFoundKernel   = a_classInfo.FindKernelByName(dsArgs.originKernelName);
...
       local["ArgNames"]   = std::vector<std::string>();
       local["IsServiceCall"] = dsArgs.isService;
       local["IsVirtual"]     = false;
-      if (pFoundKernel != a_classInfo.megakernelsByName.end())
-          local["EnableBlockExpansion"] = pFoundKernel->second.be.enabled;
+      local["EnableBlockExpansion"] = pFoundKernel->second.be.enabled;

       uint32_t realId = 0;
       for(size_t j=0;j<dsArgs.descriptorSetsInfo.size();j++)
       {
-        if(!internalKernel && !isServeceKernel && !a_classInfo.pShaderCC->IsISPC() && pFoundKernel != a_classInfo.megakernelsByName.end())
+        if(!internalKernel && !isServeceKernel && !a_classInfo.pShaderCC->IsISPC())
         {
           const bool ignoreArg = IgnoreArgForDS(j, dsArgs.descriptorSetsInfo, pFoundKernel->second.args, pFoundKernel->second.name, a_classInfo.IsRTV());
           if(ignoreArg && !isMegaKernel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant