summaryrefslogtreecommitdiff
path: root/src/analysis/scan/items
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/scan/items')
-rw-r--r--src/analysis/scan/items/maxcommon.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/analysis/scan/items/maxcommon.c b/src/analysis/scan/items/maxcommon.c
index 2fe561f..e8c4db3 100644
--- a/src/analysis/scan/items/maxcommon.c
+++ b/src/analysis/scan/items/maxcommon.c
@@ -300,6 +300,12 @@ static bool g_scan_maxcommon_function_run_call(GScanMaxcommonFunction *item, GSc
collected = malloc(arg0_count * sizeof(GScanExpression *));
scores = malloc(arg0_count * sizeof(size_t));
+ if (arg0_count == 0)
+ {
+ best = 0;
+ goto quick_empty;
+ }
+
for (i = 0; i < arg0_count; i++)
{
#ifndef NDEBUG
@@ -357,6 +363,8 @@ static bool g_scan_maxcommon_function_run_call(GScanMaxcommonFunction *item, GSc
assert(best > 0);
+ quick_empty:
+
*out = G_OBJECT(g_scan_literal_expression_new(LVT_UNSIGNED_INTEGER, (unsigned long long []){ best }));
exit: