From d94d0bcc2fc44de0273a6e80947d12d68e6b235c Mon Sep 17 00:00:00 2001 From: Rangi Date: Tue, 7 Jul 2026 16:48:44 -0400 Subject: [PATCH] Make explicit the assumption that `targetFileName` is checked before ever calling `printDep` --- include/asm/main.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/asm/main.hpp b/include/asm/main.hpp index 5d42405c..c9b3c3ae 100644 --- a/include/asm/main.hpp +++ b/include/asm/main.hpp @@ -8,6 +8,8 @@ #include #include +#include "helpers.hpp" // assume + enum MissingInclude { INC_ERROR, // A missing included file is an error that halts assembly GEN_EXIT, // A missing included file is assumed to be generated; exit normally @@ -36,6 +38,7 @@ struct Options { void printDep(std::string const &depName) { if (dependFile) { + assume(targetFileName.has_value()); fprintf(dependFile, "%s: %s\n", targetFileName->c_str(), depName.c_str()); } }