8000 Merge pull request #128 from Shopify/fix-graphviz · eileencodes/ruby@5ead1ae · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 5ead1ae

Browse files
authored
Merge pull request ruby#128 from Shopify/fix-graphviz
Dup strings so we can mutate them
2 parents d785da1 + 33e2fa4 commit 5ead1ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

yjit.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def self.graphviz_for(iseq)
6363
highlight = ->(comment) { "<b>#{comment}</b>" }
6464
linebreak = "<br align=\"left\"/>\n"
6565

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

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

0 commit comments

Comments
 (0)
0