summaryrefslogtreecommitdiff
path: root/src/runtime/c/pgf
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2017-05-16 10:55:00 +0000
committerkrasimir <krasimir@chalmers.se>2017-05-16 10:55:00 +0000
commit08f9f6fbaf39fd852b0ede4173c276fa84bc3e8d (patch)
treea372cdc6521cf6bc73bc43617573e16dbc68b4a5 /src/runtime/c/pgf
parent151184718df340f5c7e96b3e92ba2dd0e4e44b2b (diff)
bugfix in the stack handling during lookup
Diffstat (limited to 'src/runtime/c/pgf')
-rw-r--r--src/runtime/c/pgf/lookup.c8
1 files 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;