diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2023-10-16 22:08:00 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2023-10-16 22:08:00 (GMT) |
commit | 4f2fdc0f97f49b26772c2a466d22fdf84eb0f6d5 (patch) | |
tree | 4fd3c04091aaddfbe8347027bc6eb37c9f08d97a | |
parent | 981b1d41a2102bcd7a432a81c9bd6979b8c6d6c4 (diff) |
Improve the code and fix mistakes.
-rw-r--r-- | src/analysis/scan/exprs/item.c | 4 | ||||
-rw-r--r-- | src/analysis/scan/exprs/logical.c | 5 | ||||
-rw-r--r-- | src/analysis/scan/patterns/modifiers/list.c | 4 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/analysis/scan/exprs/item.c b/src/analysis/scan/exprs/item.c index b7cd970..a5a6fdf 100644 --- a/src/analysis/scan/exprs/item.c +++ b/src/analysis/scan/exprs/item.c @@ -308,6 +308,7 @@ static ScanReductionState g_scan_set_item_reduce(const GScanSetItem *expr, GScan status = g_scan_expression_get_item(expr->set, val_s, ctx, out); } + else if (vtype == LVT_UNSIGNED_INTEGER) { if (!g_scan_literal_expression_get_unsigned_integer_value(op_index, &val_u)) @@ -320,6 +321,9 @@ static ScanReductionState g_scan_set_item_reduce(const GScanSetItem *expr, GScan } + else + status = false; + result = (status ? SRS_REDUCED : SRS_UNRESOLVABLE); } diff --git a/src/analysis/scan/exprs/logical.c b/src/analysis/scan/exprs/logical.c index cc78a75..c61a44c 100644 --- a/src/analysis/scan/exprs/logical.c +++ b/src/analysis/scan/exprs/logical.c @@ -483,6 +483,11 @@ static ScanReductionState g_scan_logical_operation_reduce(const GScanLogicalOper break; + /* Pour GCC... */ + default: + result = SRS_UNRESOLVABLE; + break; + } /* Mise à jour de la progression ? */ diff --git a/src/analysis/scan/patterns/modifiers/list.c b/src/analysis/scan/patterns/modifiers/list.c index 285b89d..86fd19f 100644 --- a/src/analysis/scan/patterns/modifiers/list.c +++ b/src/analysis/scan/patterns/modifiers/list.c @@ -239,9 +239,9 @@ bool g_scan_modifier_list_add(GScanModifierList *list, GScanTokenModifier *modif } - } + free(name); - free(name); + } if (!result) goto done; |