@@ -387,12 +387,14 @@ void Variant::unsetProperty(const Variant &name) {
387387static inline bool compare_op (const binary_op_type op, const zval *op1, const zval *op2) {
388388 zval result;
389389 op (&result, NO_CONST_UNWRAP_Z (op1), NO_CONST_UNWRAP_Z (op2));
390+ throwErrorIfOccurred ();
390391 return Z_TYPE (result) == IS_TRUE;
391392}
392393
393394static inline Variant calc_op (const binary_op_type op, const zval *op1, const zval *op2) {
394395 Variant result;
395396 op (result.ptr (), NO_CONST_UNWRAP_Z (op1), NO_CONST_UNWRAP_Z (op2));
397+ throwErrorIfOccurred ();
396398 return result;
397399}
398400
@@ -425,73 +427,87 @@ Variant Variant::serialize() {
425427
426428Variant &Variant::operator ++() {
427429 increment_function (unwrap_ptr ());
430+ throwErrorIfOccurred ();
428431 return *this ;
429432}
430433
431434Variant &Variant::operator --() {
432435 decrement_function (unwrap_ptr ());
436+ throwErrorIfOccurred ();
433437 return *this ;
434438}
435439
436440Variant Variant::operator ++(int ) {
437441 auto original = *this ;
438442 increment_function (unwrap_ptr ());
443+ throwErrorIfOccurred ();
439444 return original;
440445}
441446
442447Variant Variant::operator --(int ) {
443448 auto original = *this ;
444449 decrement_function (unwrap_ptr ());
450+ throwErrorIfOccurred ();
445451 return original;
446452}
447453
448454Variant &Variant::operator +=(const Variant &v) {
449455 add_function (unwrap_ptr (), unwrap_ptr (), NO_CONST_V (v));
456+ throwErrorIfOccurred ();
450457 return *this ;
451458}
452459
453460Variant &Variant::operator -=(const Variant &v) {
454461 sub_function (unwrap_ptr (), unwrap_ptr (), NO_CONST_V (v));
462+ throwErrorIfOccurred ();
455463 return *this ;
456464}
457465
458466Variant &Variant::operator /=(const Variant &v) {
459467 div_function (ptr (), unwrap_ptr (), NO_CONST_V (v));
468+ throwErrorIfOccurred ();
460469 return *this ;
461470}
462471
463472Variant &Variant::operator *=(const Variant &v) {
464473 mul_function (unwrap_ptr (), unwrap_ptr (), NO_CONST_V (v));
474+ throwErrorIfOccurred ();
465475 return *this ;
466476}
467477
468478Variant &Variant::operator %=(const Variant &v) {
469479 mod_function (unwrap_ptr (), unwrap_ptr (), NO_CONST_V (v));
480+ throwErrorIfOccurred ();
470481 return *this ;
471482}
472483
473484Variant &Variant::operator <<=(const Variant &v) {
474485 shift_left_function (unwrap_ptr (), unwrap_ptr (), NO_CONST_V (v));
486+ throwErrorIfOccurred ();
475487 return *this ;
476488}
477489
478490Variant &Variant::operator >>=(const Variant &v) {
479491 shift_right_function (unwrap_ptr (), unwrap_ptr (), NO_CONST_V (v));
492+ throwErrorIfOccurred ();
480493 return *this ;
481494}
482495
483496Variant &Variant::operator &=(const Variant &v) {
484497 bitwise_and_function (unwrap_ptr (), unwrap_ptr (), NO_CONST_V (v));
498+ throwErrorIfOccurred ();
485499 return *this ;
486500}
487501
488502Variant &Variant::operator |=(const Variant &v) {
489503 bitwise_or_function (unwrap_ptr (), unwrap_ptr (), NO_CONST_V (v));
504+ throwErrorIfOccurred ();
490505 return *this ;
491506}
492507
493508Variant &Variant::operator ^=(const Variant &v) {
494509 bitwise_xor_function (unwrap_ptr (), unwrap_ptr (), NO_CONST_V (v));
510+ throwErrorIfOccurred ();
495511 return *this ;
496512}
497513
@@ -538,6 +554,7 @@ Variant Variant::operator^(const Variant &v) const {
538554Variant Variant::operator ~() const {
539555 Variant result{};
540556 bitwise_not_function (result.ptr (), NO_CONST_Z (unwrap_ptr ()));
557+ throwErrorIfOccurred ();
541558 return result;
542559}
543560
0 commit comments