From 457392fa64692be0927ed641369370f02afb0420 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 6 Jun 2019 01:47:22 +0300 Subject: Cheaper checks for exceptions thrown from __toString() --- ext/intl/transliterator/transliterator_class.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ext/intl/transliterator/transliterator_class.c') diff --git a/ext/intl/transliterator/transliterator_class.c b/ext/intl/transliterator/transliterator_class.c index a619ed4309..d5aac5df16 100644 --- a/ext/intl/transliterator/transliterator_class.c +++ b/ext/intl/transliterator/transliterator_class.c @@ -193,11 +193,12 @@ err: zval tmp_member; \ if( Z_TYPE_P( member ) != IS_STRING ) \ { \ - ZVAL_STR(&tmp_member, \ - zval_get_string_func(member)); \ + zend_string *_str = \ + zval_try_get_string_func(member); \ + if (UNEXPECTED(!_str)) { return_fail; } \ + ZVAL_STR(&tmp_member, _str); \ member = &tmp_member; \ cache_slot = NULL; \ - if (EG(exception)) { return_fail; } \ } #define TRANSLITERATOR_PROPERTY_HANDLER_EPILOG \ -- cgit v1.2.1