diff options
Diffstat (limited to 'tool/instruction.rb')
-rwxr-xr-x | tool/instruction.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tool/instruction.rb b/tool/instruction.rb index 6934b33e80..c6e0c40c0c 100755 --- a/tool/instruction.rb +++ b/tool/instruction.rb @@ -66,11 +66,15 @@ class RubyVM ret = "int inc = 0;\n" @opes.each_with_index{|(t, v), i| - if t == 'rb_num_t' && ((re = /\b#{v}\b/n) =~ @sp_inc || - @defopes.any?{|t, val| re =~ val}) + if (t == 'rb_num_t' && ((re = /\b#{v}\b/n) =~ @sp_inc)) || + (@defopes.any?{|t, val| re =~ val}) ret << " int #{v} = FIX2INT(opes[#{i}]);\n" + elsif (t == 'CALL_INFO' && ((re = /\b#{v}\b/n) =~ @sp_inc)) + ret << " CALL_INFO #{v} = (CALL_INFO)(opes[#{i}]);\n" end + } + @defopes.each_with_index{|((t, var), val), i| if t == 'rb_num_t' && val != '*' && /\b#{var}\b/ =~ @sp_inc ret << " #{t} #{var} = #{val};\n" |