summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-overload.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-05-30 21:15:55 -0700
committerGitHub <noreply@github.com>2023-05-30 21:15:55 -0700
commit5c28677ff8bb1ab498954795ae3907f3b6c3b03f (patch)
tree9056f65b0637a61700cd70c1af84d5b97b8c1b69 /source/slang/slang-check-overload.cpp
parent5e1974e8cad3396a8c4bedfd63c1ad31b82ec8eb (diff)
Fix type checking & loop value hoisting (#2907)
* Fix type checking crash in language server. * Fix loop var hoisting logic. Fixes #2903. * fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-overload.cpp')
-rw-r--r--source/slang/slang-check-overload.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/slang/slang-check-overload.cpp b/source/slang/slang-check-overload.cpp
index 4bd8506ed..0d10b05be 100644
--- a/source/slang/slang-check-overload.cpp
+++ b/source/slang/slang-check-overload.cpp
@@ -409,11 +409,12 @@ namespace Slang
auto& arg = context.getArg(ii);
auto argType = context.getArgType(ii);
auto paramType = paramTypes[ii];
-
+ if (!paramType)
+ return false;
+ if (!argType)
+ return false;
if (context.mode == OverloadResolveContext::Mode::JustTrying)
{
- SLANG_ASSERT(argType);
-
ConversionCost cost = kConversionCost_None;
if( context.disallowNestedConversions )
{
@@ -1656,7 +1657,11 @@ namespace Slang
for( UInt aa = 0; aa < argCount; ++aa )
{
if(aa != 0) argsListBuilder << ", ";
- context.getArgType(aa)->toText(argsListBuilder);
+ auto argType = context.getArgType(aa);
+ if (argType)
+ context.getArgType(aa)->toText(argsListBuilder);
+ else
+ argsListBuilder << "error";
}
argsListBuilder << ")";
return argsListBuilder.produceString();