]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
bit-and const-fold should use bitand not bitor
authorWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 14 Aug 2012 21:52:57 +0000 (23:52 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 14 Aug 2012 21:52:57 +0000 (23:52 +0200)
parser.c

index f45bfdca8728489141a361481d0c792b86d3c643..f8f5e97acace1c1e8c43ec927e97f7cb292b6012 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -616,7 +616,7 @@ static bool parser_sy_pop(parser_t *parser, shunt *sy)
             if (CanConstFold(exprs[0], exprs[1]))
                 out = (ast_expression*)parser_const_float(parser,
                     (op->id == opid1('|') ? (float)( ((qcint)ConstF(0)) | ((qcint)ConstF(1)) ) :
-                                            (float)( ((qcint)ConstF(0)) | ((qcint)ConstF(1)) ) ));
+                                            (float)( ((qcint)ConstF(0)) & ((qcint)ConstF(1)) ) ));
             else
                 out = (ast_expression*)ast_binary_new(ctx,
                     (op->id == opid1('|') ? INSTR_BITOR : INSTR_BITAND),