1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-25 14:20:53 +01:00

29329: fix undefined behaviour in math.c

This commit is contained in:
Mikael Magnusson 2011-05-27 01:42:30 +00:00
parent 6c6cb0e23d
commit bd2d0636d2
2 changed files with 6 additions and 2 deletions

View file

@ -11,6 +11,9 @@
* unposted: Doc/Zsh/params.yo: Document that PROMPT_EOL_MARK can * unposted: Doc/Zsh/params.yo: Document that PROMPT_EOL_MARK can
be empty, forgot in 28480. 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> 2011-05-26 Peter Stephenson <pws@csr.com>
* unposted: Etc/CONTRIBUTORS: expand. * unposted: Etc/CONTRIBUTORS: expand.
@ -14840,5 +14843,5 @@
***************************************************** *****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL * This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.5335 $ * $Revision: 1.5336 $
***************************************************** *****************************************************

View file

@ -1156,7 +1156,8 @@ op(int what)
if (tp & (OP_E2|OP_E2IO)) { if (tp & (OP_E2|OP_E2IO)) {
struct mathvalue *mvp = stack + sp + 1; struct mathvalue *mvp = stack + sp + 1;
lv = stack[sp+1].lval; lv = stack[sp+1].lval;
push(setmathvar(mvp,c), mvp->lval, 0); c = setmathvar(mvp, c);
push(c, mvp->lval, 0);
} else } else
push(c,NULL, 0); push(c,NULL, 0);
return; return;