summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2019-08-14 11:49:20 +0200
committerMaria Matejka <mq@ucw.cz>2020-05-01 15:19:12 +0200
commitd65a926a67749f8e8ffb6df9b3e2e123669b0656 (patch)
treeca80c2030f08d7c3263c527eb502f7d0c0cae102
parent30ba7c1661a13d665ae0aaa4e40cb5ed24023450 (diff)
Filter: Don't alloc varargs array if its length would be zero
-rw-r--r--filter/decl.m42
1 files changed, 1 insertions, 1 deletions
diff --git a/filter/decl.m4 b/filter/decl.m4
index efecb9a5..14b9329c 100644
--- a/filter/decl.m4
+++ b/filter/decl.m4
@@ -138,7 +138,7 @@ FID_IFCONST([[
}
FID_IFCONST([[
const struct f_inst **items = NULL;
- if (constargs) {
+ if (constargs && whati->varcount) {
items = alloca(whati->varcount * sizeof(struct f_inst *));
const struct f_inst *child = fvar;
for (uint i=0; child; i++)