monotone-commits-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-commits-diffs] net.venge.monotone.issue-176: 85d3b32d3a36d1cdb


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone.issue-176: 85d3b32d3a36d1cdb0f8e07e82bf6c8ce6228a0d
Date: Thu, 16 Feb 2012 01:27:01 +0100 (CET)

revision:            85d3b32d3a36d1cdb0f8e07e82bf6c8ce6228a0d
date:                2012-02-16T00:25:49
author:              Richard Hopkins <address@hidden>
branch:              net.venge.monotone.issue-176
changelog:
Use '<= items.size()' for error condition in 'selector::create'

When executing monotone with the reported selector, this was the error
guard causing monotone to fail. The values were lparen_pos = 2,
items.size() = 2.

I think the original use of '< items.size()' may have been a typo, as
a few lines earlier '<= items.size()' is used for finding the position
of the nearest previous '('.

The corresponding 'if' will now evaluate to false, as lparen_pos ==
items.size(), and line 796 will be executed. The error check there for
lparen_pos == 2 also ties in with the crash report of lparen_pos being 2.

The recently added 'selectors_with_parentheses' test now succeeds, along
with other selector related tests.

manifest:
format_version "1"

new_manifest [93d3489b6268eb37fa691a3a68e38801c294f799]

old_revision [d2ee901188fa37aff7ca9fe5351033ff4904759f]

patch "src/selectors.cc"
 from [3efba0ce3139290b4088cea0d6e82a912565471e]
   to [55f65c19804c6cacccf39304602b3a00f98d4603]
============================================================
--- src/selectors.cc	3efba0ce3139290b4088cea0d6e82a912565471e
+++ src/selectors.cc	55f65c19804c6cacccf39304602b3a00f98d4603
@@ -766,7 +766,7 @@ shared_ptr<selector> selector::create(op
           {
             ++lparen_pos;
           }
-        E(lparen_pos < items.size(), origin::user,
+        E(lparen_pos <= items.size(), origin::user,
           F("selector '%s' is invalid, unmatched ')'") % orig);
         I(idx(items, items.size() - lparen_pos).str == "(");
         unsigned int name_idx = items.size() - lparen_pos - 1;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]