Skip to content

Commit cfa5e72

Browse files
committed
* Propagate exception when zend_read_property reads __get and throws an exception
1 parent 293a201 commit cfa5e72

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

v8js_object_export.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -765,10 +765,12 @@ v8::Local<v8::Value> v8js_named_property_callback(v8::Local<v8::Name> property_n
765765
(property_info != ZEND_WRONG_PROPERTY_INFO &&
766766
property_info->flags & ZEND_ACC_PUBLIC)) {
767767
zval *property_val = zend_read_property(NULL, &zobject, name, name_len, true, &php_value);
768-
// special case uninitialized_zval_ptr and return an empty value
769-
// (indicating that we don't intercept this property) if the
770-
// property doesn't exist.
771-
if (property_val == &EG(uninitialized_zval)) {
768+
if(EG(exception)) {
769+
ret_value = v8js_propagate_exception(ctx);
770+
} else if (property_val == &EG(uninitialized_zval)) {
771+
// special case uninitialized_zval_ptr and return an empty value
772+
// (indicating that we don't intercept this property) if the
773+
// property doesn't exist.
772774
ret_value = v8::Local<v8::Value>();
773775
} else {
774776
// wrap it

0 commit comments

Comments
 (0)