summaryrefslogtreecommitdiffstats
path: root/src/expression.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2013-04-15 00:36:36 +0200
committerPatrick McHardy <kaber@trash.net>2013-04-18 15:28:46 +0200
commit84cf34938294e404fd7e9ebe1a630fe868ae22da (patch)
tree040ef41daf17fee350c294ed19d409d1a651a299 /src/expression.c
parenta711ab22a58504e52c33f5fd939643002d7e6a81 (diff)
expr: fix concat expression type propagation
Dynamically instantiate a data type to represent all types of a concatenation and use that for type propagation.
Diffstat (limited to 'src/expression.c')
-rw-r--r--src/expression.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/expression.c b/src/expression.c
index 0bd2bb43..8cf3f621 100644
--- a/src/expression.c
+++ b/src/expression.c
@@ -566,6 +566,12 @@ void compound_expr_remove(struct expr *compound, struct expr *expr)
list_del(&expr->list);
}
+static void concat_expr_destroy(struct expr *expr)
+{
+ concat_type_destroy(expr->dtype);
+ compound_expr_destroy(expr);
+}
+
static void concat_expr_print(const struct expr *expr)
{
compound_expr_print(expr, " . ");
@@ -576,7 +582,7 @@ static const struct expr_ops concat_expr_ops = {
.name = "concat",
.print = concat_expr_print,
.clone = compound_expr_clone,
- .destroy = compound_expr_destroy,
+ .destroy = concat_expr_destroy,
};
struct expr *concat_expr_alloc(const struct location *loc)