while (opline < end) {
switch (opline->opcode) {
- case ZEND_ADD:
- case ZEND_SUB:
- case ZEND_MUL:
- case ZEND_DIV:
- case ZEND_POW:
- if (opline->op1_type == IS_CONST) {
- if (Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_STRING) {
- /* don't optimise if it should produce a runtime numeric string error */
- if (is_numeric_string(Z_STRVAL(ZEND_OP1_LITERAL(opline)), Z_STRLEN(ZEND_OP1_LITERAL(opline)), NULL, NULL, 0)) {
- convert_scalar_to_number(&ZEND_OP1_LITERAL(opline));
- }
- }
- }
- if (opline->op2_type == IS_CONST) {
- if (Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING) {
- /* don't optimise if it should produce a runtime numeric string error */
- if (is_numeric_string(Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEND_OP2_LITERAL(opline)), NULL, NULL, 0)) {
- convert_scalar_to_number(&ZEND_OP2_LITERAL(opline));
- }
- }
- if (opline->op1_type == IS_CONST) {
- goto constant_binary_op;
- }
- }
- break;
-
- case ZEND_MOD:
- case ZEND_SL:
- case ZEND_SR:
- if (opline->op1_type == IS_CONST) {
- if (Z_TYPE(ZEND_OP1_LITERAL(opline)) != IS_LONG) {
- /* don't optimise if it should produce a runtime numeric string error */
- if (!(Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_STRING
- && !is_numeric_string(Z_STRVAL(ZEND_OP1_LITERAL(opline)), Z_STRLEN(ZEND_OP1_LITERAL(opline)), NULL, NULL, 0))) {
- convert_to_long(&ZEND_OP1_LITERAL(opline));
- }
- }
- }
- if (opline->op2_type == IS_CONST) {
- if (Z_TYPE(ZEND_OP2_LITERAL(opline)) != IS_LONG) {
- /* don't optimise if it should produce a runtime numeric string error */
- if (!(Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING
- && !is_numeric_string(Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEND_OP2_LITERAL(opline)), NULL, NULL, 0))) {
- convert_to_long(&ZEND_OP2_LITERAL(opline));
- }
- }
- if (opline->op1_type == IS_CONST) {
- goto constant_binary_op;
- }
- }
- break;
-
case ZEND_CONCAT:
case ZEND_FAST_CONCAT:
if (opline->op1_type == IS_CONST) {
}
break;
+ case ZEND_ADD:
+ case ZEND_SUB:
+ case ZEND_MUL:
+ case ZEND_DIV:
+ case ZEND_POW:
+ case ZEND_MOD:
+ case ZEND_SL:
+ case ZEND_SR:
case ZEND_BW_OR:
case ZEND_BW_AND:
case ZEND_BW_XOR: