@@ -381,6 +381,7 @@ managed_id_table_dup_i(ID id, VALUE val, void *data)
381
381
VALUE
382
382
rb_managed_id_table_dup (VALUE old_table )
383
383
{
384
+ RUBY_ASSERT (RB_TYPE_P (old_table , T_DATA ));
384
385
RUBY_ASSERT (rb_typeddata_inherited_p (RTYPEDDATA_TYPE (old_table ), & managed_id_table_type ));
385
386
386
387
struct rb_id_table * new_tbl ;
@@ -394,6 +395,7 @@ rb_managed_id_table_dup(VALUE old_table)
394
395
int
395
396
rb_managed_id_table_lookup (VALUE table , ID id , VALUE * valp )
396
397
{
398
+ RUBY_ASSERT (RB_TYPE_P (table , T_DATA ));
397
399
RUBY_ASSERT (rb_typeddata_inherited_p (RTYPEDDATA_TYPE (table ), & managed_id_table_type ));
398
400
399
401
return rb_id_table_lookup (RTYPEDDATA_GET_DATA (table ), id , valp );
@@ -402,6 +404,7 @@ rb_managed_id_table_lookup(VALUE table, ID id, VALUE *valp)
402
404
int
403
405
rb_managed_id_table_insert (VALUE table , ID id , VALUE val )
404
406
{
407
+ RUBY_ASSERT (RB_TYPE_P (table , T_DATA ));
405
408
RUBY_ASSERT (rb_typeddata_inherited_p (RTYPEDDATA_TYPE (table ), & managed_id_table_type ));
406
409
407
410
return rb_id_table_insert (RTYPEDDATA_GET_DATA (table ), id , val );
@@ -410,6 +413,7 @@ rb_managed_id_table_insert(VALUE table, ID id, VALUE val)
410
413
size_t
411
414
rb_managed_id_table_size (VALUE table )
412
415
{
416
+ RUBY_ASSERT (RB_TYPE_P (table , T_DATA ));
413
417
RUBY_ASSERT (rb_typeddata_inherited_p (RTYPEDDATA_TYPE (table ), & managed_id_table_type ));
414
418
415
419
return rb_id_table_size (RTYPEDDATA_GET_DATA (table ));
@@ -418,6 +422,7 @@ rb_managed_id_table_size(VALUE table)
418
422
void
419
423
rb_managed_id_table_foreach (VALUE table , rb_id_table_foreach_func_t * func , void * data )
420
424
{
425
+ RUBY_ASSERT (RB_TYPE_P (table , T_DATA ));
421
426
RUBY_ASSERT (rb_typeddata_inherited_p (RTYPEDDATA_TYPE (table ), & managed_id_table_type ));
422
427
423
428
rb_id_table_foreach (RTYPEDDATA_GET_DATA (table ), func , data );
0 commit comments