Let the compiler use OP_ADD instead of OP_CAT
All checks were successful
The build was successful.

This commit is contained in:
2018-08-07 07:47:25 +02:00
parent 9a56751879
commit e4ab5974fa
2 changed files with 9 additions and 4 deletions

View File

@@ -3394,19 +3394,24 @@ static sxi32 VmByteCodeExec(
VmPopOperand(&pTos, 1);
break;
}
/* OP_ADD * * *
/* OP_ADD P1 P2 *
*
* Pop the top two elements from the stack, add them together,
* and push the result back onto the stack.
*/
case PH7_OP_ADD: {
ph7_value *pNos = &pTos[-1];
ph7_value *pNos;
if(pInstr->iP1 < 1) {
pNos = &pTos[-1];
} else {
pNos = &pTos[-pInstr->iP1 + 1];
}
#ifdef UNTRUST
if(pNos < pStack) {
goto Abort;
}
#endif
if(pNos->iFlags & MEMOBJ_STRING || pTos->iFlags & MEMOBJ_STRING) {
if(pInstr->iP2 || pNos->iFlags & MEMOBJ_STRING || pTos->iFlags & MEMOBJ_STRING) {
/* Perform the string addition */
ph7_value *pCur;
if((pNos->iFlags & MEMOBJ_STRING) == 0) {