[前][次][番号順一覧][スレッド一覧]

ruby-changes:66767

From: Sutou <ko1@a...>
Date: Tue, 13 Jul 2021 19:38:23 +0900 (JST)
Subject: [ruby-changes:66767] 70b0318646 (master): [ruby/fiddle] MemoryView: ensure reset rb_memory_view_t::obj on error

https://git.ruby-lang.org/ruby.git/commit/?id=70b0318646

From 70b0318646f5372940071b727c650b96884ab63e Mon Sep 17 00:00:00 2001
From: Sutou Kouhei <kou@c...>
Date: Fri, 18 Jun 2021 09:29:46 +0900
Subject: [ruby/fiddle] MemoryView: ensure reset rb_memory_view_t::obj on error

https://github.com/ruby/fiddle/commit/0ed39345fe
---
 ext/fiddle/memory_view.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ext/fiddle/memory_view.c b/ext/fiddle/memory_view.c
index fb3ab08..3e260f9 100644
--- a/ext/fiddle/memory_view.c
+++ b/ext/fiddle/memory_view.c
@@ -109,6 +109,7 @@ rb_fiddle_memview_initialize(VALUE obj, VALUE target) https://github.com/ruby/ruby/blob/trunk/ext/fiddle/memory_view.c#L109
     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);
     }
 
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]