clc: fix SPIRVMessageConsumer for NULL src
authorKarol Herbst <git@karolherbst.de>
Fri, 16 Jun 2023 17:44:43 +0000 (19:44 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 19 Jun 2023 22:54:59 +0000 (22:54 +0000)
This happens if we pass our own validator options. It's nothing we can
control, SPIRV-Tools just passes NULL instead of "input".

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23700>

src/compiler/clc/clc_helpers.cpp

index 1f72b99..8af3944 100644 (file)
@@ -1112,7 +1112,7 @@ public:
          return;
 
       std::ostringstream message;
-      message << "(file=" << src
+      message << "(file=" << (src ? src : "input")
               << ",line=" << pos.line
               << ",column=" << pos.column
               << ",index=" << pos.index