summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-syntax.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-07-14 18:51:57 -0700
committerGitHub <noreply@github.com>2025-07-15 01:51:57 +0000
commit37143802781d8d480361d7c23202347ae3acf094 (patch)
tree300a6f60f2ddd3a0d7f14ab07665dfff5d67f31c /source/slang/slang-syntax.cpp
parentdb06fbb163877b8823507b162ee7f2dfca8520f0 (diff)
Fix language server crash. (#7756)
* Fix language server crash. * Fix tests. * Fix. * Revert changes.
Diffstat (limited to 'source/slang/slang-syntax.cpp')
-rw-r--r--source/slang/slang-syntax.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp
index bb5b574bb..67d562f0f 100644
--- a/source/slang/slang-syntax.cpp
+++ b/source/slang/slang-syntax.cpp
@@ -912,11 +912,19 @@ FuncType* getFuncType(ASTBuilder* astBuilder, DeclRef<CallableDecl> const& declR
{
List<Type*> paramTypes;
auto resultType = getResultType(astBuilder, declRef);
+
+ if (!resultType)
+ resultType = astBuilder->getErrorType();
+
auto errorType = getErrorCodeType(astBuilder, declRef);
auto visitParamDecl = [&](DeclRef<ParamDecl> paramDeclRef)
{
auto paramDecl = paramDeclRef.getDecl();
auto paramType = getParamType(astBuilder, paramDeclRef);
+ if (!paramType)
+ {
+ paramType = astBuilder->getErrorType();
+ }
if (paramDecl->findModifier<RefModifier>())
{
paramType = astBuilder->getRefType(paramType, AddressSpace::Generic);