mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/fiddle] MemoryView: ensure reset rb_memory_view_t::obj on error
https://github.com/ruby/fiddle/commit/0ed39345fe
This commit is contained in:
parent
9f86e50e1e
commit
70b0318646
1 changed files with 1 additions and 0 deletions
|
@ -109,6 +109,7 @@ rb_fiddle_memview_initialize(VALUE obj, VALUE target)
|
|||
TypedData_Get_Struct(obj, struct memview_data, &fiddle_memview_data_type, data);
|
||||
|
||||
if (!rb_memory_view_get(target, &data->view, 0)) {
|
||||
data->view.obj = Qnil;
|
||||
rb_raise(rb_eArgError, "Unable to get a memory view from %+"PRIsVALUE, target);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue