aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-03-18 15:39:22 (GMT)
committerDan Carpenter <dan.carpenter@oracle.com>2019-03-18 15:39:22 (GMT)
commit69885220072b3a52a68fb2d4a56e17663a82125e (patch)
tree5071b14d0932c2cddb9bd840a1a95c0abda8ad0b
parent5cbe4bbfc18ace0b0ad775c5102eecf5306eb712 (diff)
param_to_mtag_data: get rid of get_mtag()
The expr_to_mtag_offset() function is the new hotness... I'm not sure this code was correct to begin with and I'll need to revisit it later. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
-rw-r--r--smatch_param_to_mtag_data.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/smatch_param_to_mtag_data.c b/smatch_param_to_mtag_data.c
index b72a944..f5d6282 100644
--- a/smatch_param_to_mtag_data.c
+++ b/smatch_param_to_mtag_data.c
@@ -105,28 +105,6 @@ static void match_assign(struct expression *expr)
free_string(name);
}
-#if 0
-static void save_mtag_to_map(struct expression *expr, mtag_t tag, int offset, int param, char *key, char *value)
-{
- struct expression *arg, *gen_expr;
- mtag_t arg_tag;
-
- arg = get_argument_from_call_expr(expr->args, param);
- if (!arg)
- return;
-
- gen_expr = gen_expression_from_key(arg, key);
- if (!gen_expr)
- return;
-
- if (!get_mtag(gen_expr, &arg_tag))
- arg_tag = 0;
-
- if (local_debug)
- sm_msg("finding mtag for '%s' %lld", expr_to_str(gen_expr), arg_tag);
-}
-#endif
-
static void propogate_assignment(struct expression *expr, mtag_t tag, int offset, int param, char *key)
{
struct expression *arg;
@@ -158,6 +136,7 @@ static void assign_to_alias(struct expression *expr, int param, mtag_t tag, int
struct range_list *rl;
mtag_t arg_tag;
mtag_t alias;
+ int arg_offset;
arg = get_argument_from_call_expr(expr->args, param);
if (!arg)
@@ -174,7 +153,8 @@ static void assign_to_alias(struct expression *expr, int param, mtag_t tag, int
// insert_mtag_data(alias, offset, rl);
- if (get_mtag(gen_expr, &arg_tag))
+ // FIXME: is arg_offset handled correctly?
+ if (expr_to_mtag_offset(gen_expr, &arg_tag, &arg_offset) && arg_offset == 0)
sql_insert_mtag_map(arg_tag, -offset, alias);
}

Privacy Policy