mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
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:
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user