diff options
| author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-11 08:51:06 +0000 |
|---|---|---|
| committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-11 08:51:06 +0000 |
| commit | c56cb78599dfc3c930a5f686fee4d7613a524708 (patch) | |
| tree | 13e637ba93760ac09b2bec820a85054fb3caf729 | |
| parent | 409be50fe1407479694978d9006f289ddc857ab8 (diff) | |
* ext/dl/mkcallback.rb (mkfunc): Make sure that a callback
function is found in the function table before trying to call
it; submitted by sheepman <sheepman AT sheepman.sakura.ne.jp>
in [ruby-dev:30524].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | ext/dl/mkcallback.rb | 3 |
2 files changed, 10 insertions, 0 deletions
@@ -1,3 +1,10 @@ +Sun Mar 11 17:45:51 2007 Akinori MUSHA <knu@iDaemons.org> + + * ext/dl/mkcallback.rb (mkfunc): Make sure that a callback + function is found in the function table before trying to call + it; submitted by sheepman <sheepman AT sheepman.sakura.ne.jp> + in [ruby-dev:30524]. + Sun Mar 11 12:09:37 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> * eval.c (error_handle): no message when exiting by signal. diff --git a/ext/dl/mkcallback.rb b/ext/dl/mkcallback.rb index b7ea1718d0..c9f92e4a0d 100644 --- a/ext/dl/mkcallback.rb +++ b/ext/dl/mkcallback.rb @@ -31,6 +31,9 @@ def mkfunc(rettype, fnum, argc) subst_code, "", " obj = rb_hash_aref(DLFuncTable, rb_assoc_new(INT2NUM(#{rettype.to_s}),INT2NUM(#{fnum.to_s})));", + " if(NIL_P(obj))", + " rb_raise(rb_eDLError, \"callback function does not exist in DL::FuncTable\");", + " Check_Type(obj, T_ARRAY);", " proto = rb_ary_entry(obj, 0);", " proc = rb_ary_entry(obj, 1);", " Check_Type(proto, T_STRING);", |
