mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
113de0083e
commit
034540dbc1
3 changed files with 13 additions and 2 deletions
|
@ -1,3 +1,12 @@
|
|||
Sat Feb 5 00:59:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* 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.
|
||||
|
||||
Fri Feb 4 19:14:27 2011 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* enc/trans/utf8_mac.trans: parenthesize macro arguments.
|
||||
|
|
2
vm.c
2
vm.c
|
@ -1756,7 +1756,7 @@ thread_memsize(const void *ptr)
|
|||
}
|
||||
}
|
||||
|
||||
static const rb_data_type_t thread_data_type = {
|
||||
const rb_data_type_t thread_data_type = {
|
||||
"VM/thread",
|
||||
{
|
||||
rb_thread_mark,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue