summaryrefslogtreecommitdiff
path: root/src/analysis/scan/exprs/counter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/scan/exprs/counter.c')
-rw-r--r--src/analysis/scan/exprs/counter.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/analysis/scan/exprs/counter.c b/src/analysis/scan/exprs/counter.c
index bb4e523..7fadb91 100644
--- a/src/analysis/scan/exprs/counter.c
+++ b/src/analysis/scan/exprs/counter.c
@@ -50,7 +50,7 @@ static void g_scan_match_counter_finalize(GScanMatchCounter *);
/* Réduit une expression à une forme plus simple. */
-static ScanReductionState g_scan_match_counter_reduce(GScanMatchCounter *, GScanContext *, GScanScope *, GScanExpression **);
+static ScanReductionState g_scan_match_counter_reduce(const GScanMatchCounter *, GScanContext *, GScanScope *, GScanExpression **);
@@ -195,11 +195,14 @@ bool g_scan_match_counter_create(GScanMatchCounter *counter, GSearchPattern *pat
{
bool result; /* Bilan à retourner */
- result = true;
+ result = g_scan_expression_create(G_SCAN_EXPRESSION(counter), SRS_WAIT_FOR_SCAN);
+ if (!result) goto exit;
counter->pattern = pattern;
g_object_ref(G_OBJECT(pattern));
+ exit:
+
return result;
}
@@ -226,7 +229,7 @@ bool g_scan_match_counter_create(GScanMatchCounter *counter, GSearchPattern *pat
* *
******************************************************************************/
-static ScanReductionState g_scan_match_counter_reduce(GScanMatchCounter *expr, GScanContext *ctx, GScanScope *scope, GScanExpression **out)
+static ScanReductionState g_scan_match_counter_reduce(const GScanMatchCounter *expr, GScanContext *ctx, GScanScope *scope, GScanExpression **out)
{
ScanReductionState result; /* Etat synthétisé à retourner */
size_t count; /* Quantité de correspondances */