Skip to content

Commit

Permalink
Handle detect the ip for a line better. Fixes rubinius#719
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Phoenix committed May 3, 2011
1 parent 2720cf2 commit dba9314
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions kernel/common/compiled_method.rb
Expand Up @@ -240,14 +240,20 @@ def line_from_ip(ip)
#
# @return [Fixnum] the address of the first instruction
# OR nil if there is no ip for the given line
def first_ip_on_line(line, start=-1)
def first_ip_on_line(line, start=nil)
i = 1
total = @lines.size

while i < total
cur_line = @lines.at(i)
if cur_line >= line
ip = @lines.at(i-1)
return ip if ip > start

if !start or ip > start
# matched the definition line, return 0
return 0 if ip == -1
return ip
end
end

i += 2
Expand Down

0 comments on commit dba9314

Please sign in to comment.