diff options
Diffstat (limited to 'ext/dl')
-rw-r--r-- | ext/dl/handle.c | 5 | ||||
-rw-r--r-- | ext/dl/sym.c | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/ext/dl/handle.c b/ext/dl/handle.c index 17e8e5221d..9ca2fa0a54 100644 --- a/ext/dl/handle.c +++ b/ext/dl/handle.c @@ -138,7 +138,7 @@ rb_dlhandle_sym(int argc, VALUE argv[], VALUE self) const char *name, *stype; const char *err; - rb_secure(4); + rb_secure(2); if (rb_scan_args(argc, argv, "11", &sym, &type) == 2) { SafeStringValue(type); stype = StringValuePtr(type); @@ -159,9 +159,8 @@ rb_dlhandle_sym(int argc, VALUE argv[], VALUE self) name = StringValuePtr(sym); } - Data_Get_Struct(self, struct dl_handle, dlhandle); - if (! dlhandle->open) { + if (!dlhandle->open) { rb_raise(rb_eRuntimeError, "Closed handle."); } handle = dlhandle->ptr; diff --git a/ext/dl/sym.c b/ext/dl/sym.c index 2034c0a7ff..4a2d736465 100644 --- a/ext/dl/sym.c +++ b/ext/dl/sym.c @@ -330,7 +330,7 @@ rb_dlsym_call(int argc, VALUE argv[], VALUE self) long ftype; void *func; - rb_secure(2); + rb_secure_update(self); Data_Get_Struct(self, struct sym_data, sym); DEBUG_CODE({ printf("rb_dlsym_call(): type = '%s', func = 0x%x\n", sym->type, sym->func); |