From 462322026f1d38dba7c968e8c5f5c22617bfc05c Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Sat, 30 Nov 2024 20:26:04 +0100 Subject: [PATCH] Fix bug with missing target in `test` and crash in `benchmark`. Note that this doesn't resolve the issues with these yet. --- src/build/build_options.c | 1 + src/compiler/compiler.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/build/build_options.c b/src/build/build_options.c index 4c1000ec6..755c011d9 100644 --- a/src/build/build_options.c +++ b/src/build/build_options.c @@ -318,6 +318,7 @@ static void parse_command(BuildOptions *options) { options->command = COMMAND_TEST; options->testing = true; + parse_optional_target(options); return; } if (arg_match("run")) diff --git a/src/compiler/compiler.c b/src/compiler/compiler.c index aa5987a5e..4451c6209 100644 --- a/src/compiler/compiler.c +++ b/src/compiler/compiler.c @@ -174,7 +174,7 @@ const char *build_base_name(void) static const char *exe_name(void) { - ASSERT0(compiler.context.main || compiler.build.no_entry); + ASSERT0(compiler.build.name || compiler.context.main || compiler.build.no_entry); const char *name; if (compiler.build.name || compiler.build.no_entry) {