aboutsummaryrefslogtreecommitdiffstats
path: root/ext/dl/mkcallback.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dl/mkcallback.rb')
-rw-r--r--ext/dl/mkcallback.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/dl/mkcallback.rb b/ext/dl/mkcallback.rb
index 7738128f59..9a12184734 100644
--- a/ext/dl/mkcallback.rb
+++ b/ext/dl/mkcallback.rb
@@ -33,7 +33,8 @@ def mkfunc(rettype, fnum, argc)
" obj = rb_hash_aref(DLFuncTable, rb_assoc_new(INT2NUM(#{rettype.to_s}),INT2NUM(#{fnum.to_s})));",
" proto = rb_ary_entry(obj, 0);",
" proc = rb_ary_entry(obj, 1);",
- " rb_dl_scan_callback_args(buff, STR2CSTR(proto), &argc, argv);",
+ " Check_Type(proto, T_STRING);",
+ " rb_dl_scan_callback_args(buff, RSTRING(proto)->ptr, &argc, argv);",
" retval = rb_funcall2(proc, id_call, argc, argv);",
"",
ret_code,