SHA256
1
0
forked from pool/muparser
muparser/muparser-fix-undef.diff
Ismail Dönmez 0e7ce186f5 Accepting request 112912 from home:jengelh:branches:science
- update to new upstream release 2.2.2
* Retrieving all results of expressions made up of comma separate
  subexpressions is now possible with a new Eval overload.
* Callback functions with fixed number of arguments can now have up
  to 10 parameters
* ternary if-then-else operator added (C-like; "x?y:z")
* new intrinsic binary operators: "&&", "||" (logical and, or)
* A new bulkmode allows submitting large arrays as variables to
  compute large numbers of expressions with a single call.- enable
  parallel build

OBS-URL: https://build.opensuse.org/request/show/112912
OBS-URL: https://build.opensuse.org/package/show/science/muparser?expand=0&rev=2
2012-04-07 17:30:56 +00:00

31 lines
1.2 KiB
Diff

From: Jan Engelhardt <jengelh@medozas.de>
Date: 2012-04-06 22:49:28.359430308 +0200
Resolve undefined behavior in muParserBase
./src/muParserBase.cpp:1041:85: warning: operation on 'sidx' may be undefined [-Wsequence-point]
./src/muParserBase.cpp:1041:85: warning: operation on 'sidx' may be undefined [-Wsequence-point]
I: Program causes undefined operation
(likely same variable used twiceand post/pre incremented in the same expression).
e.g. x = x++; Split it in two operations.
W: muparser sequence-point ./src/muParserBase.cpp:1041
---
src/muParserBase.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: muparser-2.2.2/src/muParserBase.cpp
===================================================================
--- muparser-2.2.2.orig/src/muParserBase.cpp
+++ muparser-2.2.2/src/muParserBase.cpp
@@ -1038,7 +1038,8 @@ namespace mu
continue;
case cmPOW:
- Stack[--sidx] = MathImpl<value_type>::Pow(Stack[sidx], Stack[1+sidx]); ;
+ --sidx;
+ Stack[sidx] = MathImpl<value_type>::Pow(Stack[sidx], Stack[1+sidx]);
continue;
case cmLAND: --sidx; Stack[sidx] = Stack[sidx] && Stack[sidx+1]; continue;