From 9f86e50e1e03daff73a36fd8490f0457db98a641 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 17 Jun 2021 13:40:11 +0900 Subject: [PATCH] [ruby/fiddle] StringValuePtr may change the val https://github.com/ruby/fiddle/commit/bddca7c895 --- ext/fiddle/pointer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/fiddle/pointer.c b/ext/fiddle/pointer.c index c5fb442aec..9336f0431c 100644 --- a/ext/fiddle/pointer.c +++ b/ext/fiddle/pointer.c @@ -770,6 +770,7 @@ rb_fiddle_ptr_s_to_ptr(VALUE self, VALUE val) } else if (RTEST(rb_obj_is_kind_of(val, rb_cString))){ char *str = StringValuePtr(val); + wrap = val; ptr = rb_fiddle_ptr_new(str, RSTRING_LEN(val), NULL); } else if ((vptr = rb_check_funcall(val, id_to_ptr, 0, 0)) != Qundef){