Reviewers: ,

Message:
FindBreakLocationFromAddress algorithm is identical to
FindBreakLocationFromPosition (10 lines below), except this very detail.

What's more, the following check
if (distance == 0)
is going to never success without the fix.

This changes semantics of the method. However, it looks like exact sharp pc that
is never actually passed to this method.

Description:
Fix very strange bug in FindBreakLocationFromAddress algorithm

Please review this at https://codereview.chromium.org/15737023/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/debug.cc


Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index 91af9ccc1bab32cb351006da1d51de108c6a006e..8958f47a3e23393f7c895c4db3ccd640f3620946 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -218,7 +218,7 @@ void BreakLocationIterator::FindBreakLocationFromAddress(Address pc) {
   int distance = kMaxInt;
   while (!Done()) {
     // Check if this break point is closer that what was previously found.
-    if (this->pc() < pc && pc - this->pc() < distance) {
+    if (this->pc() <= pc && pc - this->pc() < distance) {
       closest_break_point = break_point();
       distance = static_cast<int>(pc - this->pc());
       // Check whether we can't get any closer.


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to