From 6c671f17f00844147419252846c7014ae051ff57 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 6 Feb 2013 18:14:20 +0300 Subject: [PATCH] parse_call_math: silence "internal bug: pop_val popping empty list" There is a bogus warning message printed when the parameter passed is not a known fixed number. I've created a version of pop_until() to clear the stacks without printing a warning message. Signed-off-by: Dan Carpenter --- smatch_parse_call_math.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/smatch_parse_call_math.c b/smatch_parse_call_math.c index 59fe1cc0..ab4fb30d 100644 --- a/smatch_parse_call_math.c +++ b/smatch_parse_call_math.c @@ -125,6 +125,14 @@ static void pop_until(char c) } } +static void discard_stacks() +{ + while (op_list) + pop_op(); + while (num_list) + pop_val(); +} + static int get_implied_param(struct expression *call, int param, sval_t *sval) { struct expression *arg; @@ -210,7 +218,7 @@ int parse_call_math(struct expression *call, char *math, sval_t *sval) *sval = pop_val(); return 1; fail: - pop_until(0); /* discard stack */ + discard_stacks(); return 0; } -- 2.11.4.GIT