aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-12-14 16:50:11 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-12-15 11:48:58 +0100
commitc3845651306e50ab8b410accdeb322442d61e342 (patch)
tree06beb61a0ba9884580641ad68b46021e823576b3
parent82dee2e25887f26df7126d6789a419eaf14beb8c (diff)
downloadsparse-c3845651306e50ab8b410accdeb322442d61e342.tar.gz
mark strings as examined & evaluated
evaluate_string() leaves the strings it creates as unexamined & unevaluated. More exactly, they are examined and evaluated (they have correct size & type) but not marked as such. This doesn't seem to really matter but shows up when auditing if classify_type() is always used on examined symbols. So, mark the strings as examined and evaluated since their size & type are known. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--evaluate.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/evaluate.c b/evaluate.c
index 34578be8..539ef803 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -110,6 +110,8 @@ static struct symbol *evaluate_string(struct expression *expr)
sym->ctype.modifiers = MOD_STATIC;
sym->ctype.base_type = array;
sym->initializer = initstr;
+ sym->examined = 1;
+ sym->evaluated = 1;
initstr->ctype = sym;
initstr->string = expr->string;
@@ -119,6 +121,8 @@ static struct symbol *evaluate_string(struct expression *expr)
array->ctype.alignment = 1;
array->ctype.modifiers = MOD_STATIC;
array->ctype.base_type = &char_ctype;
+ array->examined = 1;
+ array->evaluated = 1;
addr->symbol = sym;
addr->ctype = &lazy_ptr_ctype;