From a9f01c0c911afabc86dfc210f3ea596f1c35de6e Mon Sep 17 00:00:00 2001 From: Nikolay Khitrin Date: Tue, 20 Feb 2024 23:35:54 +0300 Subject: [PATCH] SetGlobals: Fix segfault on invalid input (#6321) --- src/passes/SetGlobals.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/passes/SetGlobals.cpp b/src/passes/SetGlobals.cpp index 3bcbb3d31c9..5e24184fa55 100644 --- a/src/passes/SetGlobals.cpp +++ b/src/passes/SetGlobals.cpp @@ -41,7 +41,7 @@ struct SetGlobals : public Pass { auto value = nameAndValue[1]; auto* glob = module->getGlobalOrNull(name); if (!glob) { - std::cerr << "warning: could not find global: " << name << '\n'; + Fatal() << "Could not find global: " << name; } // Parse the input. Literal lit;