mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/fiddle] StringValuePtr may change the val
https://github.com/ruby/fiddle/commit/bddca7c895
This commit is contained in:
parent
10e26cfa76
commit
9f86e50e1e
1 changed files with 1 additions and 0 deletions
|
@ -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){
|
||||
|
|
Loading…
Reference in a new issue