summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-impl.h
diff options
context:
space:
mode:
authorsriramm-nv <85252063+sriramm-nv@users.noreply.github.com>2024-04-03 15:10:16 -0700
committerGitHub <noreply@github.com>2024-04-03 15:10:16 -0700
commitf6c49fdb2cc7ead1943d944097220cedd142792f (patch)
tree86f8a09544d89cab007f3168f10396bcee73d12e /source/slang/slang-check-impl.h
parent2768e429e556f3978825beaf71cf361626057135 (diff)
Fix assertions due to malformed switch statements (#3858)
* Fix assertions due to malformed switch statements Fixes the issue #2955 * Checks for multiple case statements with same values * Checks for multiple default cases * Constant-folds case exprs into an Integer value * fix the comments, and updated error code * one-line comment on diagnostic code
Diffstat (limited to 'source/slang/slang-check-impl.h')
-rw-r--r--source/slang/slang-check-impl.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/slang/slang-check-impl.h b/source/slang/slang-check-impl.h
index 48bd2093b..55edba6b9 100644
--- a/source/slang/slang-check-impl.h
+++ b/source/slang/slang-check-impl.h
@@ -2741,6 +2741,9 @@ namespace Slang
void tryInferLoopMaxIterations(ForStmt* stmt);
void checkLoopInDifferentiableFunc(Stmt* stmt);
+
+ private:
+ void validateCaseStmts(SwitchStmt* stmt, DiagnosticSink* sink);
};
struct SemanticsDeclVisitorBase