[hackers] [scc] Promote integer values in numericaluop() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 4 Sep 2015 20:22:39 +0200 (CEST)

commit 121cea8b715ba2ca3a8c5abc4b330ded023a7cf8
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Sep 4 20:19:09 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri Sep 4 20:19:09 2015 +0200

    Promote integer values in numericaluop()
    
    Numericaluop() is called with unary numerical operators, which
    can be floats or integers, and in the case of integers is mandatory
    to do the integer promotion.

diff --git a/cc1/expr.c b/cc1/expr.c
index 8ce08b3..bf7282f 100644
--- a/cc1/expr.c
+++ b/cc1/expr.c
_AT_@ -129,6 +129,7 @@ numericaluop(char op, Node *np)
 {
         switch (BTYPE(np)) {
         case INT:
+ np = promote(np);
         case FLOAT:
                 if (op == ONEG && np->op == ONEG)
                         return np->left;
Received on Fri Sep 04 2015 - 20:22:39 CEST

This archive was generated by hypermail 2.3.0 : Fri Sep 04 2015 - 20:24:31 CEST