mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ext: use RARRAY_CONST_PTR
* ext/bigdecimal/bigdecimal.c: use RARRAY_CONST_PTR just fore reference instead of RARRAY_PTR, to keep the array WB-protected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
52912db4a8
commit
3553a86eb5
20 changed files with 123 additions and 106 deletions
|
@ -110,7 +110,7 @@ initialize(int argc, VALUE argv[], VALUE self)
|
|||
arg_types = xcalloc(RARRAY_LEN(args) + 1, sizeof(ffi_type *));
|
||||
|
||||
for (i = 0; i < RARRAY_LEN(args); i++) {
|
||||
int type = NUM2INT(RARRAY_PTR(args)[i]);
|
||||
int type = NUM2INT(RARRAY_CONST_PTR(args)[i]);
|
||||
arg_types[i] = INT2FFI_TYPE(type);
|
||||
}
|
||||
arg_types[RARRAY_LEN(args)] = NULL;
|
||||
|
@ -164,7 +164,7 @@ function_call(int argc, VALUE argv[], VALUE self)
|
|||
values = (void **)((char *)generic_args + (size_t)argc * sizeof(fiddle_generic));
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
VALUE type = RARRAY_PTR(types)[i];
|
||||
VALUE type = RARRAY_CONST_PTR(types)[i];
|
||||
VALUE src = argv[i];
|
||||
|
||||
if(NUM2INT(type) == TYPE_VOIDP) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue