summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-syntax.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-05-15 18:07:36 -0700
committerGitHub <noreply@github.com>2024-05-15 18:07:36 -0700
commit3b0de8b6ea484091146f61e663c63beeac5b4798 (patch)
tree8093bc0af8d0801435c29abf5c5f1fdd3e7cc09a /source/slang/slang-syntax.cpp
parentcc88530a722cc2ce7a09f2a39dadeeb504e2f221 (diff)
Add diagnostic to prevent defining unsized variables. (#4168)
* Add diagnostic to prevent defining unsized static variables. * Fix tests. * Add more tests. * Fix to allow defining variables of link-time size. * update diagnostic message. * Fix tests. * Simplify code.
Diffstat (limited to 'source/slang/slang-syntax.cpp')
-rw-r--r--source/slang/slang-syntax.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp
index b6fd8936e..0b92d07af 100644
--- a/source/slang/slang-syntax.cpp
+++ b/source/slang/slang-syntax.cpp
@@ -25,6 +25,8 @@ void printDiagnosticArg(StringBuilder& sb, Decl* decl)
void printDiagnosticArg(StringBuilder& sb, DeclRefBase* declRefBase)
{
+ if (!declRefBase)
+ return;
printDiagnosticArg(sb, declRefBase->getDecl());
}