From 3b0de8b6ea484091146f61e663c63beeac5b4798 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 15 May 2024 18:07:36 -0700 Subject: 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. --- source/slang/slang-syntax.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/slang/slang-syntax.cpp') 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()); } -- cgit v1.2.3