summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--ext/fiddle/closure.c7
-rw-r--r--version.h2
3 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 7fe337e536..8a2788b144 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Fri Feb 14 15:17:17 2014 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value.
+ [ruby-core:57599] [Bug #8978].
+
+Fri Feb 14 15:17:17 2014 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value.
+ [ruby-core:57599] [Bug #8978]. Thanks mame!
+
Fri Feb 14 15:04:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* thread_pthread.c (rb_thread_create_timer_thread): fix for platforms
diff --git a/ext/fiddle/closure.c b/ext/fiddle/closure.c
index 21796660c4..a1413206fd 100644
--- a/ext/fiddle/closure.c
+++ b/ext/fiddle/closure.c
@@ -21,7 +21,7 @@ dealloc(void * ptr)
#ifndef DONT_USE_FFI_CLOSURE_ALLOC
ffi_closure_free(cls->pcl);
#else
- munmap(cls->pcl, sizeof(cls->pcl));
+ munmap(cls->pcl, sizeof(*cls->pcl));
#endif
if (cls->argv) xfree(cls->argv);
xfree(cls);
@@ -228,7 +228,10 @@ initialize(int rbargc, VALUE argv[], VALUE self)
#else
result = ffi_prep_closure(pcl, cif, callback, (void *)self);
cl->code = (void *)pcl;
- mprotect(pcl, sizeof(pcl), PROT_READ | PROT_EXEC);
+ i = mprotect(pcl, sizeof(*pcl), PROT_READ | PROT_EXEC);
+ if (i) {
+ rb_sys_fail("mprotect");
+ }
#endif
if (FFI_OK != result)
diff --git a/version.h b/version.h
index d76d9d9766..2dbc4c3c87 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 522
+#define RUBY_PATCHLEVEL 523
#define RUBY_RELEASE_DATE "2014-02-14"
#define RUBY_RELEASE_YEAR 2014