summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/math.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 55fdd95eb..f390032d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,9 @@
* unposted: Doc/Zsh/params.yo: Document that PROMPT_EOL_MARK can
be empty, forgot in 28480.
+ * 29329: Src/math.c: Fix undefined behaviour in function argument
+ evaluation order.
+
2011-05-26 Peter Stephenson <pws@csr.com>
* unposted: Etc/CONTRIBUTORS: expand.
@@ -14840,5 +14843,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5335 $
+* $Revision: 1.5336 $
*****************************************************
diff --git a/Src/math.c b/Src/math.c
index 377d1ac9c..beef74525 100644
--- a/Src/math.c
+++ b/Src/math.c
@@ -1156,7 +1156,8 @@ op(int what)
if (tp & (OP_E2|OP_E2IO)) {
struct mathvalue *mvp = stack + sp + 1;
lv = stack[sp+1].lval;
- push(setmathvar(mvp,c), mvp->lval, 0);
+ c = setmathvar(mvp, c);
+ push(c, mvp->lval, 0);
} else
push(c,NULL, 0);
return;