From 7d0d706260200277199791a79546cea3c6dc1657 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 13 Nov 2012 00:59:35 +0100 Subject: when doing a reverse search, allocate array of matches (since it can currently get very large) --- parser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'parser.cpp') diff --git a/parser.cpp b/parser.cpp index a3352a1..578b787 100644 --- a/parser.cpp +++ b/parser.cpp @@ -1028,7 +1028,7 @@ StateSearch::process(const gchar *str, gint new_chars __attribute__((unused))) gint from, to; }; /* at most one match per character */ - Range matched[parameters.to - parameters.from]; + Range *matched = new Range[parameters.to - parameters.from]; gint i = 0; while (g_match_info_matches(info)) { @@ -1045,6 +1045,8 @@ StateSearch::process(const gchar *str, gint new_chars __attribute__((unused))) matched_from = matched[i + parameters.count].from; matched_to = matched[i + parameters.count].to; } + + delete matched; } g_match_info_free(info); -- cgit v1.2.3