mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-27 16:50:58 +01:00
16448: math assignment bug introduced by 15291, 15292
This commit is contained in:
parent
126d3b9468
commit
64ba6ab245
2 changed files with 11 additions and 1 deletions
|
|
@ -497,7 +497,7 @@ pop(int noget)
|
|||
if (mv->val.type == MN_UNSET && !noget)
|
||||
mv->val = getnparam(mv->lval);
|
||||
sp--;
|
||||
return mv->val;
|
||||
return errflag ? zero_mnumber : mv->val;
|
||||
}
|
||||
|
||||
/**/
|
||||
|
|
@ -630,6 +630,8 @@ op(int what)
|
|||
DPUTS(sp < 1, "BUG: math: not enough wallabies in outback.");
|
||||
b = pop(0);
|
||||
a = pop(what == EQ);
|
||||
if (errflag)
|
||||
return;
|
||||
|
||||
if (tp & (OP_A2IO|OP_E2IO)) {
|
||||
/* coerce to integers */
|
||||
|
|
@ -856,6 +858,8 @@ op(int what)
|
|||
c = pop(0);
|
||||
b = pop(0);
|
||||
a = pop(0);
|
||||
if (errflag)
|
||||
return;
|
||||
/* b and c can stay different types in this case. */
|
||||
push(((a.type & MN_FLOAT) ? a.u.d : a.u.l) ? b : c, NULL, 0);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue