]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
ast_ternary needs to adopt the output type
authorWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 21 Nov 2012 19:57:00 +0000 (20:57 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 21 Nov 2012 19:57:00 +0000 (20:57 +0100)
ast.c

diff --git a/ast.c b/ast.c
index f6a5d87455150021484edcffee3d4ebb389e0d07..7d7443f882300c2eb5eecea99190f017fdaf5461 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -652,6 +652,11 @@ ast_ternary* ast_ternary_new(lex_ctx ctx, ast_expression *cond, ast_expression *
     self->on_true  = ontrue;
     self->on_false = onfalse;
 
+    if (!ast_type_adopt(self, ontrue)) {
+        ast_ternary_delete(self);
+        return NULL;
+    }
+
     return self;
 }