summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-decl.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-06-04 13:07:11 -0700
committerGitHub <noreply@github.com>2025-06-04 13:07:11 -0700
commit2d7106640addf0ac88e0a5462117cd90b13a5e73 (patch)
tree6ce27db4d6c5bf06db84dee755a82e09b1b3a2ca /source/slang/slang-check-decl.cpp
parent812e478989e27983b8dea7ab11964de751654ba2 (diff)
Add legalization for 0-sized arrays. (#7327)
* Add legalization for 0-sized arrays. * Allow 0-sized arrays in the front-end. * More tests. * Add `Conditional<T, hasValue>` type to core module. * Update toc. * Fix wording. * Update test.
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
-rw-r--r--source/slang/slang-check-decl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index e3b05ec00..aa84a057f 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -10120,7 +10120,7 @@ void SemanticsVisitor::validateArraySizeForVariable(VarDeclBase* varDecl)
// TODO(tfoley): How to handle the case where bound isn't known?
auto elementCount = arrayType->getElementCount();
- if (GetMinBound(elementCount) <= 0)
+ if (GetMinBound(elementCount) < 0)
{
getSink()->diagnose(varDecl, Diagnostics::invalidArraySize);
return;