summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-10-02 00:32:43 +0800
committerGitHub <noreply@github.com>2024-10-01 09:32:43 -0700
commitc6427e36b31df41c6415570f4e8277f56e265c2a (patch)
tree4a721e7cb09a0c4567b806f12dad0f6d1f8ed79c
parente2e624b9abe509d5628666d0b97059bdcf08bdf3 (diff)
SizeOfLikeExpr has type int (#5205)
* Correct typo in parser * SizeOfLineExprs have type int Fixes https://github.com/shader-slang/slang/issues/5191
-rw-r--r--source/slang/slang-check-expr.cpp1
-rw-r--r--source/slang/slang-parser.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index bdf8721e9..e9c257750 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -3393,6 +3393,7 @@ namespace Slang
Expr* SemanticsExprVisitor::visitSizeOfLikeExpr(SizeOfLikeExpr* sizeOfLikeExpr)
{
auto valueExpr = dispatch(sizeOfLikeExpr->value);
+ sizeOfLikeExpr->type = m_astBuilder->getIntType();
Type* type = nullptr;
diff --git a/source/slang/slang-parser.cpp b/source/slang/slang-parser.cpp
index 926b3c1d9..06d470a5f 100644
--- a/source/slang/slang-parser.cpp
+++ b/source/slang/slang-parser.cpp
@@ -1781,7 +1781,7 @@ namespace Slang
if (expr->typeExpr)
expr->typeExpr->accept(this, nullptr);
}
- void visiSizeOfLikeExpr(SizeOfLikeExpr* expr)
+ void visitSizeOfLikeExpr(SizeOfLikeExpr* expr)
{
if (expr->value)
expr->value->accept(this, nullptr);