diff options
author | Ray Molenkamp <github@lazydodo.com> | 2019-10-08 18:46:09 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2019-10-08 18:46:09 +0300 |
commit | ed9f8bd9566f0657558ca27b9cb16288a7ead074 (patch) | |
tree | 0028b1fb3ccbd389a76f090e9791d9558309f2bf /source/blender/blenlib/intern/expr_pylike_eval.c | |
parent | 10ec207a6b1fdefe247b3e092d0b62a373ab1464 (diff) |
CTest: Fix failing test BLI_expr_pylike_eval_test on clang/windows
clang got a little to aggressive discarding unused variables
see D6012 for details.
Differential Revision: https://developer.blender.org/D6012
Reviewers: brecht, sergey, angavrilov
Diffstat (limited to 'source/blender/blenlib/intern/expr_pylike_eval.c')
-rw-r--r-- | source/blender/blenlib/intern/expr_pylike_eval.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/expr_pylike_eval.c b/source/blender/blenlib/intern/expr_pylike_eval.c index 14fc4c5bf26..b3692926838 100644 --- a/source/blender/blenlib/intern/expr_pylike_eval.c +++ b/source/blender/blenlib/intern/expr_pylike_eval.c @@ -504,7 +504,9 @@ static bool parse_add_func(ExprParseState *state, eOpCode code, int args, void * if (jmp_gap >= 1 && prev_ops[-1].opcode == OPCODE_CONST) { UnaryOpFunc func = funcptr; - double result = func(prev_ops[-1].arg.dval); + /* volatile because some compilers overly agressive optimize this call out. + * see D6012 for details. */ + volatile double result = func(prev_ops[-1].arg.dval); if (fetestexcept(FE_DIVBYZERO | FE_INVALID) == 0) { prev_ops[-1].arg.dval = result; @@ -520,7 +522,9 @@ static bool parse_add_func(ExprParseState *state, eOpCode code, int args, void * prev_ops[-1].opcode == OPCODE_CONST) { BinaryOpFunc func = funcptr; - double result = func(prev_ops[-2].arg.dval, prev_ops[-1].arg.dval); + /* volatile because some compilers overly agressive optimize this call out. + * see D6012 for details. */ + volatile double result = func(prev_ops[-2].arg.dval, prev_ops[-1].arg.dval); if (fetestexcept(FE_DIVBYZERO | FE_INVALID) == 0) { prev_ops[-2].arg.dval = result; |