Skip to content

Commit

Permalink
Merge pull request ruby#128 from Shopify/fix-graphviz
Browse files Browse the repository at this point in the history
Dup strings so we can mutate them
  • Loading branch information
maximecb committed Jul 15, 2021
2 parents d785da1 + 33e2fa4 commit 5ead1ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yjit.rb
Expand Up @@ -63,7 +63,7 @@ def self.graphviz_for(iseq)
highlight = ->(comment) { "<b>#{comment}</b>" }
linebreak = "<br align=\"left\"/>\n"

buff = ''
buff = +''
blocks = blocks_for(iseq).sort_by(&:id)
buff << "digraph g {\n"

Expand Down Expand Up @@ -103,7 +103,7 @@ def self.graphviz_for(iseq)
def self.disasm_block(cs, block, highlight)
comments = comments_for(block.address, block.address + block.code.length)
comment_idx = 0
str = ''
str = +''
cs.disasm(block.code, block.address).each do |i|
while (comment = comments[comment_idx]) && comment.address <= i.address
str << " ; #{highlight.call(comment.comment)}\n"
Expand Down

0 comments on commit 5ead1ae

Please sign in to comment.