Print this page
12257 resync smatch to 0.6.1-rc1-il-4
@@ -48,11 +48,11 @@
#include <openssl/md5.h>
static int my_id;
-static mtag_t str_to_tag(const char *str)
+mtag_t str_to_mtag(const char *str)
{
unsigned char c[MD5_DIGEST_LENGTH];
unsigned long long *tag = (unsigned long long *)&c;
MD5_CTX mdContext;
int len;
@@ -130,11 +130,11 @@
return state;
right_name = expr_to_str(right);
snprintf(buf, sizeof(buf), "%s %s %s %s", get_filename(), get_function(),
left_name, right_name);
- tag = str_to_tag(buf);
+ tag = str_to_mtag(buf);
tag_sval.type = estate_type(state);
tag_sval.uvalue = tag;
rl = rl_filter(estate_rl(state), valid_ptr_rl);
rl = clone_rl(rl);
@@ -154,12 +154,12 @@
if (expr->type != EXPR_STRING || !expr->string)
return 0;
/* I was worried about collisions so I added a xor */
- xor = str_to_tag("__smatch string");
- *tag = str_to_tag(expr->string->data);
+ xor = str_to_mtag("__smatch string");
+ *tag = str_to_mtag(expr->string->data);
*tag = *tag ^ xor;
return 1;
}
@@ -175,11 +175,11 @@
return 0;
snprintf(buf, sizeof(buf), "%s %s",
(sym->ctype.modifiers & MOD_STATIC) ? get_filename() : "extern",
sym->ident->name);
- *tag = str_to_tag(buf);
+ *tag = str_to_mtag(buf);
return 1;
}
bool get_symbol_mtag(struct symbol *sym, mtag_t *tag)
{
@@ -194,11 +194,11 @@
if (get_param_num_from_sym(sym) >= 0)
return false;
snprintf(buf, sizeof(buf), "%s %s %s",
get_filename(), get_function(), sym->ident->name);
- *tag = str_to_tag(buf);
+ *tag = str_to_mtag(buf);
return true;
}
static void global_variable(struct symbol *sym)
{
@@ -256,11 +256,11 @@
return rl;
name = expr_to_str(expr);
snprintf(buf, sizeof(buf), "%s %s %s", get_filename(), get_function(), name);
free_string(name);
- tag = str_to_tag(buf);
+ tag = str_to_mtag(buf);
sval.value = tag;
return alloc_rl(sval, sval);
}
int create_mtag_alias(mtag_t tag, struct expression *expr, mtag_t *new)
@@ -282,11 +282,11 @@
lines_from_start = expr->pos.line - cur_func_sym->pos.line;
str = expr_to_str(expr);
snprintf(buf, sizeof(buf), "%lld %d %s", tag, lines_from_start, str);
free_string(str);
- *new = str_to_tag(buf);
+ *new = str_to_mtag(buf);
sql_insert_mtag_alias(tag, *new);
return 1;
}