summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Oliver Nutter <headius@headius.com>2020-02-23 12:49:26 -0800
committerCharles Oliver Nutter <headius@headius.com>2020-03-03 08:42:25 -0600
commit03f9e8746e42a4835583678af217cdf4c417bd05 (patch)
tree5545e3a10b62dc474fe3f187152b6b42eaab6f26
parent43ed4eb6d1cbbd31de2c98ae515630ee8f988c1e (diff)
Don't tweak RubyVM compile options if it's not defined
-rw-r--r--test/ruby/test_settracefunc.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb
index 73cf625258..300033ae7e 100644
--- a/test/ruby/test_settracefunc.rb
+++ b/test/ruby/test_settracefunc.rb
@@ -3,17 +3,21 @@ require 'test/unit'
class TestSetTraceFunc < Test::Unit::TestCase
def setup
- @original_compile_option = RubyVM::InstructionSequence.compile_option
- RubyVM::InstructionSequence.compile_option = {
- :trace_instruction => true,
- :specialized_instruction => false
- }
+ if defined?(RubyVM)
+ @original_compile_option = RubyVM::InstructionSequence.compile_option
+ RubyVM::InstructionSequence.compile_option = {
+ :trace_instruction => true,
+ :specialized_instruction => false
+ }
+ end
@target_thread = Thread.current
end
def teardown
set_trace_func(nil)
- RubyVM::InstructionSequence.compile_option = @original_compile_option
+ if defined?(RubyVM)
+ RubyVM::InstructionSequence.compile_option = @original_compile_option
+ end
@target_thread = nil
end