Fix incorrect evaluation of && and ||

f29d768 forgot to switch these two `expr->nVal` to `src1->nVal`
This won't break anything, since this wasn't published yet.
I checked, and didn't see any other missed changes.

Reported by pret, I confirmed that `1 && 1` evaluated to 0.
This commit is contained in:
ISSOtm
2019-09-08 21:12:31 +02:00
parent 9faa5c7a9e
commit 7a45fc68d9

View File

@@ -233,7 +233,7 @@ void rpn_LOGOR(struct Expression *expr, const struct Expression *src1,
const struct Expression *src2)
{
joinexpr();
expr->nVal = (expr->nVal || src2->nVal);
expr->nVal = (src1->nVal || src2->nVal);
pushbyte(expr, RPN_LOGOR);
expr->nRPNPatchSize++;
}
@@ -242,7 +242,7 @@ void rpn_LOGAND(struct Expression *expr, const struct Expression *src1,
const struct Expression *src2)
{
joinexpr();
expr->nVal = (expr->nVal && src2->nVal);
expr->nVal = (src1->nVal && src2->nVal);
pushbyte(expr, RPN_LOGAND);
expr->nRPNPatchSize++;
}