Implement short-circuit evaluation for the null coalescing operator
Build / AerScript (push) Successful in 40s
Build / AerScript (push) Successful in 40s
This commit is contained in:
@@ -2344,11 +2344,18 @@ static sxi32 VmByteCodeExec(
|
||||
*
|
||||
* Take the jump if the top value is not zero (TRUE jump).Pop the top most
|
||||
* entry in the stack if P1 is zero.
|
||||
* If P1 is 2, test for a non-empty value without converting or popping it.
|
||||
*/
|
||||
case PH7_OP_JMPNZ:
|
||||
if(pTos < pStack) {
|
||||
goto Abort;
|
||||
}
|
||||
if(pInstr->iP1 == 2) {
|
||||
if(!PH7_MemObjIsNull(pTos)) {
|
||||
pc = pInstr->iP2 - 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* Get a boolean value */
|
||||
if((pTos->nType & MEMOBJ_BOOL) == 0) {
|
||||
PH7_MemObjToBool(pTos);
|
||||
|
||||
Reference in New Issue
Block a user