From: Jérémie Astor Date: Tue, 16 Feb 2021 15:15:38 +0000 (+0100) Subject: :bug: Fix faulty constant folding X-Git-Tag: nightly~956 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=e9289592dc0c5e6b6be7be02a57b5a5004a9f4aa;p=gwion.git :bug: Fix faulty constant folding --- diff --git a/src/lib/prim.c b/src/lib/prim.c index 3bc8ec2d..2b8410cc 100644 --- a/src/lib/prim.c +++ b/src/lib/prim.c @@ -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, ||,,)