From 08f9f6fbaf39fd852b0ede4173c276fa84bc3e8d Mon Sep 17 00:00:00 2001 From: krasimir Date: Tue, 16 May 2017 10:55:00 +0000 Subject: [PATCH] bugfix in the stack handling during lookup --- src/runtime/c/pgf/lookup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/c/pgf/lookup.c b/src/runtime/c/pgf/lookup.c index 8741da22c..53a70f36c 100644 --- a/src/runtime/c/pgf/lookup.c +++ b/src/runtime/c/pgf/lookup.c @@ -347,6 +347,10 @@ pgf_lookup_filter(GuBuf* join, PgfMetaId cat_id, GuSeq* counts, GuBuf* stack) if (cat_id == 0) return true; + size_t count = gu_seq_get(counts, size_t, cat_id); + if (count > 0) + return true; + size_t n_stack = gu_buf_length(stack); for (size_t i = 0; i < n_stack; i++) { PgfMetaId id = gu_buf_get(stack, PgfMetaId, i); @@ -355,10 +359,6 @@ pgf_lookup_filter(GuBuf* join, PgfMetaId cat_id, GuSeq* counts, GuBuf* stack) } } gu_buf_push(stack, PgfMetaId, cat_id); - - size_t count = gu_seq_get(counts, size_t, cat_id); - if (count > 0) - return true; size_t pos = 0; size_t maximum = 0;