summaryrefslogtreecommitdiff
path: root/ext/fiddle/pointer.c
diff options
context:
space:
mode:
authorSutou Kouhei <kou@clear-code.com>2021-06-17 13:40:11 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-13 19:37:45 +0900
commit9f86e50e1e03daff73a36fd8490f0457db98a641 (patch)
treea4eeffb448060e4462f8dbf8de50242929d49ef8 /ext/fiddle/pointer.c
parent10e26cfa76468dea6f828dbe8031b5ffcff543cb (diff)
[ruby/fiddle] StringValuePtr may change the val
https://github.com/ruby/fiddle/commit/bddca7c895
Diffstat (limited to 'ext/fiddle/pointer.c')
-rw-r--r--ext/fiddle/pointer.c1
1 files changed, 1 insertions, 0 deletions
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){