From c67dc0dce78384dfdc436fec88c804aebc9bd382 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 15 Jul 2026 09:40:07 +0900 Subject: [PATCH] Pass Prism file paths as Ruby strings Create system errors from the filepath VALUE so the full path is retained without relying on a NUL terminator or a separate GC guard. --- prism_compile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/prism_compile.c b/prism_compile.c index bba486c9720..d1ed2cbb339 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -11540,8 +11540,7 @@ error_generic: error = rb_exc_new3(rb_eLoadError, message); rb_ivar_set(error, rb_intern_const("@path"), filepath); } else { - error = rb_syserr_new(err, RSTRING_PTR(filepath)); - RB_GC_GUARD(filepath); + error = rb_syserr_new_str(err, filepath); } return error;