1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* load.c (ruby_init_ext): don't free the given pointer itself.

It is not guaranteed even that the pointer is on heap.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yugui 2012-03-16 05:45:39 +00:00
parent 58d1b85c78
commit a157c85a7f
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Fri Mar 16 14:43:18 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* load.c (ruby_init_ext): don't free the given pointer itself.
It is not guaranteed even that the pointer is on heap.
Fri Mar 16 14:37:57 2012 Shugo Maeda <shugo@ruby-lang.org>
* vm_eval.c (rb_mod_module_eval): fix the documentation of

5
load.c
View file

@ -681,11 +681,12 @@ init_ext_call(VALUE arg)
RUBY_FUNC_EXPORTED void
ruby_init_ext(const char *name, void (*init)(void))
{
if (load_lock(name)) {
char* const lock_key = load_lock(name);
if (lock_key) {
rb_vm_call_cfunc(rb_vm_top_self(), init_ext_call, (VALUE)init,
0, rb_str_new2(name));
rb_provide(name);
load_unlock(name, 1);
load_unlock(lock_key, 1);
}
}