diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-21 23:35:11 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-21 23:35:11 +0000 |
| commit | aad987120da05942fb918eb80c357747474fe9a5 (patch) | |
| tree | 676343b4c9954419be5d5f8e3567301949cfa74d /ext | |
| parent | ab299b6d3ee84569cbf93985116bd122829ac016 (diff) | |
| download | ruby-aad987120da05942fb918eb80c357747474fe9a5.tar.gz ruby-aad987120da05942fb918eb80c357747474fe9a5.tar.xz ruby-aad987120da05942fb918eb80c357747474fe9a5.zip | |
* ext/dl/sym.c (rb_dlsym_initialize): extract internal pointers after
all argument conversion. fixed: [ruby-dev:25271]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/dl/sym.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/dl/sym.c b/ext/dl/sym.c index 751b2be39..7151d3c04 100644 --- a/ext/dl/sym.c +++ b/ext/dl/sym.c @@ -154,8 +154,9 @@ rb_dlsym_initialize(int argc, VALUE argv[], VALUE self) rb_scan_args(argc, argv, "12", &addr, &name, &type); saddr = (void*)(DLNUM2LONG(rb_Integer(addr))); - sname = NIL_P(name) ? NULL : StringValuePtr(name); + if (!NIL_P(name)) StringValue(name); stype = NIL_P(type) ? NULL : StringValuePtr(type); + sname = NIL_P(name) ? NULL : RSTRING(name)->ptr; if( saddr ){ Data_Get_Struct(self, struct sym_data, data); |
