Skip to content

Commit

Permalink
fix AbstractClassPrivate::readDimension and AbstractClassPrivate::wri…
Browse files Browse the repository at this point in the history
…teDimension bug
  • Loading branch information
zzusoftboy committed Oct 18, 2017
1 parent d9291d8 commit c9e64b0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/vm/AbstractClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,12 @@ zend_class_entry *AbstractClassPrivate::initialize(AbstractClass *cls, const std
entry.iterator_funcs.funcs = IteratorBridge::getIteratorFuncs();
}

// check if serializable
if (m_apiPtr->serializable()) {
entry.serialize = &AbstractClassPrivate::serialize;
entry.unserialize = &AbstractClassPrivate::unserialize;
}
// check if serializable

if (m_parent) {
if (m_parent->m_implPtr->m_classEntry) {
m_classEntry = zend_register_internal_class_ex(&entry, m_parent->m_implPtr->m_classEntry);
Expand Down Expand Up @@ -396,7 +397,7 @@ zval *AbstractClassPrivate::readDimension(zval *object, zval *offset, int type,
return nullptr; // unreachable, prevent some compiler warning
}
} else {
if (std_object_handlers.read_dimension) {
if (!std_object_handlers.read_dimension) {
return nullptr;
} else {
return std_object_handlers.read_dimension(object, offset, type, returnValue);
Expand All @@ -414,7 +415,7 @@ void AbstractClassPrivate::writeDimension(zval *object, zval *offset, zval *valu
process_exception(exception);
}
} else {
if (std_object_handlers.write_dimension) {
if (!std_object_handlers.write_dimension) {
return;
} else {
std_object_handlers.write_dimension(object, offset, value);
Expand Down

0 comments on commit c9e64b0

Please sign in to comment.