ruby-changes:60899
From: Nobuyoshi <ko1@a...>
Date: Sat, 25 Apr 2020 11:15:23 +0900 (JST)
Subject: [ruby-changes:60899] 42ac3f79ba (master): Assert that typed data is distinguished from non-typed
https://git.ruby-lang.org/ruby.git/commit/?id=42ac3f79ba From 42ac3f79ba7104b234546f906f51de485d3a1823 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sat, 25 Apr 2020 09:29:27 +0900 Subject: Assert that typed data is distinguished from non-typed diff --git a/gc.c b/gc.c index 67c3556..56e907a 100644 --- a/gc.c +++ b/gc.c @@ -2327,6 +2327,7 @@ rb_imemo_new_debug(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0, https://github.com/ruby/ruby/blob/trunk/gc.c#L2327 VALUE rb_data_object_wrap(VALUE klass, void *datap, RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree) { + RUBY_ASSERT_ALWAYS(dfree != (RUBY_DATA_FUNC)1); if (klass) Check_Type(klass, T_CLASS); return newobj_of(klass, T_DATA, (VALUE)dmark, (VALUE)dfree, (VALUE)datap, FALSE); } @@ -2342,6 +2343,7 @@ rb_data_object_zalloc(VALUE klass, size_t size, RUBY_DATA_FUNC dmark, RUBY_DATA_ https://github.com/ruby/ruby/blob/trunk/gc.c#L2343 VALUE rb_data_typed_object_wrap(VALUE klass, void *datap, const rb_data_type_t *type) { + RUBY_ASSERT_ALWAYS(type); if (klass) Check_Type(klass, T_CLASS); return newobj_of(klass, T_DATA, (VALUE)type, (VALUE)1, (VALUE)datap, type->flags & RUBY_FL_WB_PROTECTED); } -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/