X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=ast.c;h=7d7443f882300c2eb5eecea99190f017fdaf5461;hb=6983142c4d782bcb49595eeca0fb8883ecd9479c;hp=f6a5d87455150021484edcffee3d4ebb389e0d07;hpb=be52ca3879b6857e905074b541af3b39897f8719;p=xonotic%2Fgmqcc.git diff --git a/ast.c b/ast.c index f6a5d87..7d7443f 100644 --- 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; }