summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-07-22 08:47:50 -0700
committerGitHub <noreply@github.com>2025-07-22 15:47:50 +0000
commit52a45890b5ab71d7dbfdd01955afce129728d67e (patch)
tree141491e9c36cfa6a1a890765682d69ac4bfd2270 /source/slang/slang-check-expr.cpp
parent0d26dbaad90f5eac604e148971d14e552bf9d5b8 (diff)
Fix crash when private ctor is used for coercion. (#7858)
* Fix crash when private ctor is used for coercion. * Fix tests. * Fix. * Fix test error.
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index 2891c316f..6fed59621 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -2845,6 +2845,9 @@ Expr* SemanticsVisitor::CheckInvokeExprWithCheckedOperands(InvokeExpr* expr)
auto rs = ResolveInvoke(expr);
if (auto invoke = as<InvokeExpr>(rs))
{
+ if (!invoke->functionExpr)
+ return rs;
+
// if this is still an invoke expression, test arguments passed to inout/out parameter are
// LValues
if (auto funcType = as<FuncType>(invoke->functionExpr->type))