Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Handle detect the ip for a line better. Fixes #719

  • Loading branch information...
commit dba9314d7ca2d291c77459e8a253d7e874897b2f 1 parent 2720cf2
Evan Phoenix authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 kernel/common/compiled_method.rb
View
10 kernel/common/compiled_method.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.