diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-04 16:05:40 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-04 16:05:40 +0000 |
commit | 034540dbc1f761221c1977465b13b00b4f558108 (patch) | |
tree | f2f20b4467573142a8f2fc676384eda1eb7881b3 /vm_core.h | |
parent | 113de0083e58282e1a411e8364951c98c3dddaaf (diff) | |
download | ruby-034540dbc1f761221c1977465b13b00b4f558108.tar.gz |
* vm_core.h (GetThreadPtr): use TypedData_Get_Struct() instead
CoreDataFromValue() because we need type check. Otherwise,
type mismatch can cause segmentation fault crash.
[ruby-core:35086] [Ruby 1.9-Bug#4367]
* vm.c (thread_data_type): remove static.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -347,8 +347,10 @@ typedef struct rb_block_struct { VALUE proc; } rb_block_t; +extern const rb_data_type_t thread_data_type; + #define GetThreadPtr(obj, ptr) \ - GetCoreDataFromValue((obj), rb_thread_t, (ptr)) + TypedData_Get_Struct((obj), rb_thread_t, &thread_data_type, (ptr)) enum rb_thread_status { THREAD_TO_KILL, |