Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b6fb92e

Browse files
committed
Get it working on TruffleRuby
1 parent ba8cad0 commit b6fb92e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/syntax_tree/yarv/instruction_sequence.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ class InstructionSequence
1313
# pass a serialized iseq to Ruby and have it return a
1414
# RubyVM::InstructionSequence object.
1515
ISEQ_LOAD =
16-
Fiddle::Function.new(
17-
Fiddle::Handle::DEFAULT["rb_iseq_load"],
18-
[Fiddle::TYPE_VOIDP] * 3,
19-
Fiddle::TYPE_VOIDP
20-
)
16+
begin
17+
Fiddle::Function.new(
18+
Fiddle::Handle::DEFAULT["rb_iseq_load"],
19+
[Fiddle::TYPE_VOIDP] * 3,
20+
Fiddle::TYPE_VOIDP
21+
)
22+
rescue NameError
23+
end
2124

2225
# This object is used to track the size of the stack at any given time. It
2326
# is effectively a mini symbolic interpreter. It's necessary because when
@@ -141,6 +144,7 @@ def length
141144
end
142145

143146
def eval
147+
raise "Unsupported platform" if ISEQ_LOAD.nil?
144148
compiled = to_a
145149

146150
# Temporary hack until we get these working.

0 commit comments

Comments
 (0)