Skip to content

Commit bddca7c

Browse files
committed
StringValuePtr may change the val
1 parent 1de64b7 commit bddca7c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/fiddle/pointer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ rb_fiddle_ptr_s_to_ptr(VALUE self, VALUE val)
770770
}
771771
else if (RTEST(rb_obj_is_kind_of(val, rb_cString))){
772772
char *str = StringValuePtr(val);
773+
wrap = val;
773774
ptr = rb_fiddle_ptr_new(str, RSTRING_LEN(val), NULL);
774775
}
775776
else if ((vptr = rb_check_funcall(val, id_to_ptr, 0, 0)) != Qundef){

0 commit comments

Comments
 (0)