summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
authorArielG-NV <159081215+ArielG-NV@users.noreply.github.com>2024-06-28 19:44:02 -0400
committerGitHub <noreply@github.com>2024-06-29 07:44:02 +0800
commitea4ebe39663f12f6ffbe4378ed6a8c7cba6a3e8a (patch)
treed5193e29ade0c378677a53684e13bee09d91fafc /source/slang/slang-check-expr.cpp
parent0b5190226b3061597f0fd88ca6b1f304f2c6af38 (diff)
Nested initialization list in struct crash fix (#4491)
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index d0b82c6bd..f79e23b42 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -4176,6 +4176,10 @@ namespace Slang
Expr* SemanticsExprVisitor::visitInitializerListExpr(InitializerListExpr* expr)
{
+ // If we are assigned a type, expr has already been legalized
+ if(expr->type)
+ return expr;
+
// When faced with an initializer list, we first just check the sub-expressions blindly.
// Actually making them conform to a desired type will wait for when we know the desired
// type based on context.