10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2ba05a commit 9bbf893Copy full SHA for 9bbf893
bootstraptest/test_ujit.rb
@@ -0,0 +1,30 @@
1
+# Method redefinition (code invalidation) test
2
+assert_equal '1', %q{
3
+ def ret1
4
+ return 1
5
+ end
6
+
7
+ klass = Class.new do
8
+ def alias_then_hash(klass, method_to_redefine)
9
+ # Redefine the method to be ret1
10
+ klass.alias_method(method_to_redefine, :ret1)
11
+ hash
12
13
14
15
+ instance = klass.new
16
17
+ i = 0
18
+ while i < 12
19
+ if i < 11
20
+ # Redefine the bar method
21
+ instance.alias_then_hash(klass, :bar)
22
+ else
23
+ # Redefine the hash method to be ret1
24
+ retval = instance.alias_then_hash(klass, :hash)
25
26
+ i += 1
27
28
29
+ retval
30
+}
test/ruby/test_microjit.rb
0 commit comments