rallhook 0.7.4 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ 0.7.5 Fixed issue 13 (Segmentation fault in ruby 1.9)
2
+
1
3
  0.7.4 Fixed issue 12 (Compile error for ruby 1.9)
2
4
 
3
5
  0.7.3 Fixed issue 10 (Compile Error in i486 Arch (-ldistorm64 not found) )
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rake/gempackagetask'
6
6
 
7
7
  spec = Gem::Specification.new do |s|
8
8
  s.name = 'rallhook'
9
- s.version = '0.7.4'
9
+ s.version = '0.7.5'
10
10
  s.author = 'Dario Seminara'
11
11
  s.email = 'robertodarioseminara@gmail.com'
12
12
  s.platform = Gem::Platform::RUBY
@@ -241,6 +241,8 @@ VALUE hook(VALUE self, VALUE hook_proc) {
241
241
 
242
242
  put_redirect_handler( rallhook_redirect_handler );
243
243
 
244
+ hook_rb_add_method();
245
+
244
246
  enable_redirect(tinfo_from_thread(rb_thread_current()));
245
247
 
246
248
  if (rb_block_given_p() ) {
@@ -118,7 +118,13 @@ void rb_add_method_fake(
118
118
  if (FL_TEST(klass, FL_SINGLETON)) {
119
119
  // singleton method over classes are illegal
120
120
  if ( strcmp( rb_class2name(klass), "Class") == 0) {
121
+
122
+ #ifdef RUBY1_9
123
+ st_data_t result;
124
+ #endif
125
+ #ifdef RUBY1_8
121
126
  int result;
127
+ #endif
122
128
  if (st_lookup(RCLASS(klass)->m_tbl,id,&result) ) {
123
129
  rb_raise(rb_eSecurityError, "Illegal overwrite of singleton method %s", rb_id2name(id) );
124
130
  }
@@ -131,7 +137,6 @@ void rb_add_method_fake(
131
137
  } else {
132
138
  rb_add_method_copy(klass,id,node,noex);
133
139
  }
134
-
135
140
  }
136
141
 
137
142
  void shadow_redirect(VALUE* klass, VALUE* recv, ID* mid) {
@@ -144,9 +149,7 @@ void shadow_redirect(VALUE* klass, VALUE* recv, ID* mid) {
144
149
 
145
150
  int add_method_code_changed = 0;
146
151
 
147
- void init_restrict_def() {
148
-
149
-
152
+ void hook_rb_add_method() {
150
153
  if (!add_method_code_changed) {
151
154
 
152
155
  void* handle = dlopen(current_libruby(),0x101);
@@ -163,6 +166,9 @@ void init_restrict_def() {
163
166
 
164
167
  add_method_code_changed = 1;
165
168
  }
169
+ }
170
+
171
+ void init_restrict_def() {
166
172
 
167
173
  __shadow___id = rb_intern("__shadow__");
168
174
  __unshadow___id = rb_intern("__unshadow__");
@@ -34,4 +34,6 @@ VALUE unshadow(VALUE klass) ;
34
34
 
35
35
  VALUE shadow_or_create(VALUE klass);
36
36
 
37
+ void hook_rb_add_method();
38
+
37
39
  #endif
@@ -100,8 +100,9 @@ pthread_mutex_t put_redirect_handler_mutex;
100
100
  int put_redirect_handler( REDIRECTHANDLER redirect_handler) {
101
101
 
102
102
  pthread_mutex_lock(&put_redirect_handler_mutex);
103
- put_redirect_handler_(redirect_handler);
103
+ int ret = put_redirect_handler_(redirect_handler);
104
104
  pthread_mutex_unlock(&put_redirect_handler_mutex);
105
+ return ret;
105
106
  }
106
107
 
107
108
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rallhook
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 4
10
- version: 0.7.4
9
+ - 5
10
+ version: 0.7.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dario Seminara
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-23 00:00:00 -03:00
18
+ date: 2010-08-07 00:00:00 -03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency