]> Nishi Git Mirror - gwion.git/commitdiff
:bug: Fix faulty constant folding
authorJérémie Astor <fennecdjay@gmail.com>
Tue, 16 Feb 2021 15:15:38 +0000 (16:15 +0100)
committerJérémie Astor <fennecdjay@gmail.com>
Tue, 16 Feb 2021 15:15:38 +0000 (16:15 +0100)
src/lib/prim.c

index 3bc8ec2d9060e45b98a67e339d05397bd9fcb6b3..2b8410cc0fa40eb0108cd04d8ca2ca994ff9a8a4 100644 (file)
@@ -264,8 +264,8 @@ static OP_CHECK(opck_implicit_i2f) {
 
 BINARY_INT_FLOAT_FOLD(add, et_float, +,,)
 BINARY_INT_FLOAT_FOLD(sub, et_float, -,,)
-BINARY_INT_FLOAT_FOLD(mul, et_float, *,POWEROF2_OPT(name, <<),)
-BINARY_INT_FLOAT_FOLD(div, et_float, /,POWEROF2_OPT(name, >>),if(bin->rhs->d.prim.d.fnum == 0)ERR_N(exp_self(bin)->pos, _("ZeroDivideException")))
+BINARY_INT_FLOAT_FOLD(mul, et_float, *,/*POWEROF2_OPT(name, <<)*/,)
+BINARY_INT_FLOAT_FOLD(div, et_float, /,/*POWEROF2_OPT(name, >>)*/,if(bin->rhs->d.prim.d.fnum == 0)ERR_N(exp_self(bin)->pos, _("ZeroDivideException")))
 BINARY_INT_FLOAT_FOLD2(gt,   et_bool, >,,)
 BINARY_INT_FLOAT_FOLD2(ge,   et_bool, >=,,)
 BINARY_INT_FLOAT_FOLD2(lt,   et_bool, <=,,)
@@ -321,8 +321,8 @@ static GWION_IMPORT(intfloat) {
 
 BINARY_FLOAT_INT_FOLD(add,  et_float, +,,)
 BINARY_FLOAT_INT_FOLD(sub,  et_float, -,,)
-BINARY_FLOAT_INT_FOLD(mul,  et_float, *,POWEROF2_OPT(name, <<),)
-BINARY_FLOAT_INT_FOLD(div,  et_float, /,POWEROF2_OPT(name, >>),if(bin->rhs->d.prim.d.num == 0)ERR_N(exp_self(bin)->pos, _("ZeroDivideException")))
+BINARY_FLOAT_INT_FOLD(mul,  et_float, *,/*POWEROF2_OPT(name, <<)*/,)
+BINARY_FLOAT_INT_FOLD(div,  et_float, /,/*POWEROF2_OPT(name, >>)*/,if(bin->rhs->d.prim.d.num == 0)ERR_N(exp_self(bin)->pos, _("ZeroDivideException")))
 
 BINARY_FLOAT_INT_FOLD2(gt,   et_bool, >,,)
 BINARY_FLOAT_INT_FOLD2(ge,   et_bool, >=,,)
@@ -440,8 +440,8 @@ static GWION_IMPORT(time) {
 
 BINARY_FLOAT_FOLD(add, et_float, +,,)
 BINARY_FLOAT_FOLD(sub, et_float, -,,)
-BINARY_FLOAT_FOLD(mul, et_float, *,POWEROF2_OPT(name, <<),)
-BINARY_FLOAT_FOLD(div, et_float, /,POWEROF2_OPT(name, >>),if(bin->rhs->d.prim.d.fnum == 0)ERR_N(exp_self(bin)->pos, _("ZeroDivideException")))
+BINARY_FLOAT_FOLD(mul, et_float, *,/*POWEROF2_OPT(name, <<)*/,)
+BINARY_FLOAT_FOLD(div, et_float, /,/*POWEROF2_OPT(name, >>)*/,if(bin->rhs->d.prim.d.fnum == 0)ERR_N(exp_self(bin)->pos, _("ZeroDivideException")))
 //BINARY_FLOAT_FOLD(mod, et_float, %,, if(bin->rhs->d.prim.d.fnum == 0)ERR_N(exp_self(bin)->pos, _("ZeroDivideException")))
 BINARY_FLOAT_FOLD2(and, et_bool, &&,,)
 BINARY_FLOAT_FOLD2(or,  et_bool, ||,,)