From da67cd4eb0bff7931b7ef7f157e1029ce0195812 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Mon, 29 Sep 2025 00:16:26 +0200 Subject: [PATCH] Assert when the binary doesn't get created and --run-once is used. #2502 --- releasenotes.md | 1 + src/compiler/compiler.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/releasenotes.md b/releasenotes.md index 5ece4d41d..39a4f1759 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -40,6 +40,7 @@ - Incorrect nameof on nested struct names. #2492 - Issue not correctly aborting compilation on recursive generics. - Crash during codegen when taking the typeid of an empty enum with associated values. +- Assert when the binary doesn't get created and --run-once is used. #2502 ### Stdlib changes - Added generic `InterfaceList` to store a list of values that implement a specific interface diff --git a/src/compiler/compiler.c b/src/compiler/compiler.c index 24ab6df52..ea7c732fc 100644 --- a/src/compiler/compiler.c +++ b/src/compiler/compiler.c @@ -791,6 +791,10 @@ void compiler_compile(void) } name = scratch_buffer_to_string(); const char *full_path = realpath(scratch_buffer_to_string(), NULL); + if (!full_path) + { + error_exit("The binary '%s' was unexpectedly not found.", scratch_buffer_to_string()); + } OUTF("Launching %s", name); FOREACH(const char *, arg, compiler.build.args) {