summaryrefslogtreecommitdiff
path: root/src/xact.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-02-27 04:08:39 -0600
committerJohn Wiegley <johnw@newartisans.com>2012-02-27 04:08:39 -0600
commitee530f94338ab8c3130a1e8b52dfa481bdfe596c (patch)
treede040d83e70a944d56dca19f539de52a53675a3e /src/xact.cc
parent3d8cad77c4fc5f8221fdf0a29766360b47c5f63c (diff)
downloadfork-ledger-ee530f94338ab8c3130a1e8b52dfa481bdfe596c.tar.gz
fork-ledger-ee530f94338ab8c3130a1e8b52dfa481bdfe596c.tar.bz2
fork-ledger-ee530f94338ab8c3130a1e8b52dfa481bdfe596c.zip
Fixed the scoping of auto xact predicates
Diffstat (limited to 'src/xact.cc')
-rw-r--r--src/xact.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/xact.cc b/src/xact.cc
index 08dccaf2..5da61b7b 100644
--- a/src/xact.cc
+++ b/src/xact.cc
@@ -619,6 +619,8 @@ void auto_xact_t::extend_xact(xact_base_t& xact)
if (initial_post->has_flags(ITEM_GENERATED))
continue;
+ bind_scope_t bound_scope(*scope_t::default_scope, *initial_post);
+
bool matches_predicate = false;
if (try_quick_match) {
try {
@@ -646,14 +648,13 @@ void auto_xact_t::extend_xact(xact_base_t& xact)
DEBUG("xact.extend.fail",
"The quick matcher failed, going back to regular eval");
try_quick_match = false;
- matches_predicate = predicate(*initial_post);
+ matches_predicate = predicate(bound_scope);
}
} else {
- matches_predicate = predicate(*initial_post);
+ matches_predicate = predicate(bound_scope);
}
- if (matches_predicate) {
- bind_scope_t bound_scope(*scope_t::default_scope, *initial_post);
+ if (matches_predicate) {
if (deferred_notes) {
foreach (deferred_tag_data_t& data, *deferred_notes) {
if (data.apply_to_post == NULL)
@@ -661,6 +662,7 @@ void auto_xact_t::extend_xact(xact_base_t& xact)
data.overwrite_existing);
}
}
+
if (check_exprs) {
foreach (check_expr_pair& pair, *check_exprs) {
if (pair.second == auto_xact_t::EXPR_GENERAL) {