[augeas-devel] augeas: master - * src/pathx.c (eval_filter): correctly hande realloc of value_pool
David Lutterkort
lutter at fedoraproject.org
Tue Mar 24 23:07:58 UTC 2009
Gitweb: http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=a6461b12d63144fe42d6108d2d8b802fdebbd472
Commit: a6461b12d63144fe42d6108d2d8b802fdebbd472
Parent: b58b000de577a818c04a1961428d8831a9f94083
Author: David Lutterkort <lutter at redhat.com>
AuthorDate: Mon Mar 23 18:41:45 2009 -0700
Committer: David Lutterkort <lutter at redhat.com>
CommitterDate: Tue Mar 24 15:54:01 2009 -0700
* src/pathx.c (eval_filter): correctly hande realloc of value_pool
---
src/pathx.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/pathx.c b/src/pathx.c
index 3fe9e96..017d142 100644
--- a/src/pathx.c
+++ b/src/pathx.c
@@ -891,9 +891,12 @@ static void eval_filter(struct expr *expr, struct state *state) {
} else {
eval_expr(expr->primary, state);
CHECK_ERROR;
- struct value *primary = pop_value(state);
+ value_ind_t primary_ind = pop_value_ind(state);
+ struct value *primary = state->value_pool + primary_ind;
assert(primary->tag == T_NODESET);
ns_filter(primary->nodeset, expr->predicates, state);
+ /* Evaluating predicates might have reallocated the value_pool */
+ primary = state->value_pool + primary_ind;
ns_from_locpath(lp, &maxns, &ns, primary->nodeset, state);
}
CHECK_ERROR;
More information about the augeas-devel
mailing list