Skip to content

Commit 7ef8c47

Browse files
committed
Enable check for core data types by RUBY_DEBUG
1 parent eae7300 commit 7ef8c47

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

vm_core.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,14 @@ struct rb_calling_info {
323323

324324
struct rb_execution_context_struct;
325325

326-
#if 1
326+
#ifndef RUBY_CORE_DATA_TYPE_CHECK
327+
# if RUBY_DEBUG
328+
# define RUBY_CORE_DATA_TYPE_CHECK 1
329+
# else
330+
# define RUBY_CORE_DATA_TYPE_CHECK 0
331+
# endif
332+
#endif
333+
#if !RUBY_CORE_DATA_TYPE_CHECK
327334
#define GetCoreDataFromValue(obj, type, data_type, ptr) ((ptr) = (type*)RTYPEDDATA_GET_DATA(obj))
328335
#else
329336
#define GetCoreDataFromValue(obj, type, data_type, ptr) TypedData_Get_Struct(obj, type, data_type, ptr)

0 commit comments

Comments
 (0)