@@ -324,11 +324,10 @@ struct rb_calling_info {
324324struct rb_execution_context_struct ;
325325
326326#if 1
327- #define CoreDataFromValue (obj , type ) (type*)DATA_PTR (obj)
327+ #define GetCoreDataFromValue (obj , type , data_type , ptr ) ((ptr) = ( type*)RTYPEDDATA_GET_DATA (obj) )
328328#else
329- #define CoreDataFromValue (obj , type ) (type*)rb_data_object_get( obj)
329+ #define GetCoreDataFromValue (obj , type , data_type , ptr ) TypedData_Get_Struct( obj, type, data_type, ptr )
330330#endif
331- #define GetCoreDataFromValue (obj , type , ptr ) ((ptr) = CoreDataFromValue((obj), type))
332331
333332typedef struct rb_iseq_location_struct {
334333 VALUE pathobj ; /* String (path) or Array [path, realpath]. Frozen. */
@@ -635,8 +634,10 @@ enum ruby_special_exceptions {
635634 ruby_special_error_count
636635};
637636
637+ extern const rb_data_type_t ruby_vm_data_type ;
638+
638639#define GetVMPtr (obj , ptr ) \
639- GetCoreDataFromValue((obj), rb_vm_t, (ptr))
640+ GetCoreDataFromValue((obj), rb_vm_t, &ruby_vm_data_type , (ptr))
640641
641642struct rb_vm_struct ;
642643typedef void rb_vm_at_exit_func (struct rb_vm_struct * );
@@ -1282,8 +1283,10 @@ RUBY_EXTERN VALUE rb_mRubyVMFrozenCore;
12821283RUBY_EXTERN VALUE rb_block_param_proxy ;
12831284RUBY_SYMBOL_EXPORT_END
12841285
1286+ extern const rb_data_type_t ruby_proc_data_type ;
1287+
12851288#define GetProcPtr (obj , ptr ) \
1286- GetCoreDataFromValue((obj), rb_proc_t, (ptr))
1289+ GetCoreDataFromValue((obj), rb_proc_t, &ruby_proc_data_type , (ptr))
12871290
12881291typedef struct {
12891292 const struct rb_block block ;
@@ -1309,7 +1312,7 @@ typedef struct {
13091312extern const rb_data_type_t ruby_binding_data_type ;
13101313
13111314#define GetBindingPtr (obj , ptr ) \
1312- GetCoreDataFromValue((obj), rb_binding_t, (ptr))
1315+ GetCoreDataFromValue((obj), rb_binding_t, &ruby_binding_data_type , (ptr))
13131316
13141317typedef struct {
13151318 const struct rb_block block ;
0 commit comments