From c30a3ed027f2ea03d98aedf677368542ee6ca873 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 30 Sep 2024 18:17:42 +0900 Subject: [PATCH] Fix the last character index in an assertion Also, when `RUBY_DEBUG` is enabled, objects allocated in shared-gc fail at `rb_ractor_confirm_belonging`, so assert it always. --- gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gc.c b/gc.c index c1a9b600448d7e..ba7007da39da8c 100644 --- a/gc.c +++ b/gc.c @@ -658,7 +658,7 @@ static void ruby_external_gc_init(void) { // Assert that the directory path ends with a / - GC_ASSERT(SHARED_GC_DIR[strlen(SHARED_GC_DIR) - 2] == '/'); + RUBY_ASSERT_ALWAYS(SHARED_GC_DIR[sizeof(SHARED_GC_DIR) - 2] == '/'); char *gc_so_file = getenv(RUBY_GC_LIBRARY);