diff options
Diffstat (limited to 'ruby.c')
-rw-r--r-- | ruby.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -629,7 +629,13 @@ ruby_init_loadpath(void) #if defined(LOAD_RELATIVE) || defined(__MACH__) VALUE libruby_path = runtime_libruby_path(); # if defined(__MACH__) - rb_libruby_selfpath = libruby_path; + VALUE selfpath = libruby_path; +# if defined(LOAD_RELATIVE) + selfpath = rb_str_dup(selfpath); +# endif + rb_obj_hide(selfpath); + OBJ_FREEZE_RAW(selfpath); + rb_libruby_selfpath = selfpath; rb_gc_register_address(&rb_libruby_selfpath); # endif #endif |