Skip to content

Commit

Permalink
merge revision(s) 44731,44751: [Backport #8978]
Browse files Browse the repository at this point in the history
	* ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value.
	  [ruby-core:57599] [Bug #8978].  Thanks mame!

	* ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value.
	  [ruby-core:57599] [Bug #8978].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@44941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
unak committed Feb 14, 2014
1 parent 5bcb47d commit 503badb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
10 changes: 10 additions & 0 deletions 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
Expand Down
7 changes: 5 additions & 2 deletions ext/fiddle/closure.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down

0 comments on commit 503badb

Please sign in to comment.