Skip to content

Commit 12e31fe

Browse files
committed
merge revision(s) 44731,44751: [Backport ruby#8978]
* ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value. [ruby-core:57599] [Bug ruby#8978]. Thanks mame! * ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value. [ruby-core:57599] [Bug ruby#8978]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@44941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 38e925b commit 12e31fe

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
Fri Feb 14 15:17:17 2014 Yusuke Endoh <mame@tsg.ne.jp>
2+
3+
* ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value.
4+
[ruby-core:57599] [Bug #8978].
5+
6+
Fri Feb 14 15:17:17 2014 Aaron Patterson <aaron@tenderlovemaking.com>
7+
8+
* ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value.
9+
[ruby-core:57599] [Bug #8978]. Thanks mame!
10+
111
Fri Feb 14 15:04:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
212

313
* thread_pthread.c (rb_thread_create_timer_thread): fix for platforms

ext/fiddle/closure.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dealloc(void * ptr)
2121
#ifndef DONT_USE_FFI_CLOSURE_ALLOC
2222
ffi_closure_free(cls->pcl);
2323
#else
24-
munmap(cls->pcl, sizeof(cls->pcl));
24+
munmap(cls->pcl, sizeof(*cls->pcl));
2525
#endif
2626
if (cls->argv) xfree(cls->argv);
2727
xfree(cls);
@@ -228,7 +228,10 @@ initialize(int rbargc, VALUE argv[], VALUE self)
228228
#else
229229
result = ffi_prep_closure(pcl, cif, callback, (void *)self);
230230
cl->code = (void *)pcl;
231-
mprotect(pcl, sizeof(pcl), PROT_READ | PROT_EXEC);
231+
i = mprotect(pcl, sizeof(*pcl), PROT_READ | PROT_EXEC);
232+
if (i) {
233+
rb_sys_fail("mprotect");
234+
}
232235
#endif
233236

234237
if (FFI_OK != result)

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define RUBY_VERSION "1.9.3"
2-
#define RUBY_PATCHLEVEL 522
2+
#define RUBY_PATCHLEVEL 523
33

44
#define RUBY_RELEASE_DATE "2014-02-14"
55
#define RUBY_RELEASE_YEAR 2014

0 commit comments

Comments
 (0)