SharedVariant* SharedVariant::convertObj(CVarRef var) {
  if (!var.is(KindOfObject) || getObjAttempted()) {
    return NULL;
  }
  setObjAttempted();
  PointerSet seen;
  ObjectData *obj = var.getObjectData();
  CArrRef arr = obj->o_toArray();
  if (arr->hasInternalReference(seen, true)) {
    return NULL;
  }
  SharedVariant *tmp = new SharedVariant(var, false, true, true);
  tmp->setObjAttempted();
  return tmp;
}
예제 #2
0
SharedVariant* SharedVariant::convertObj(CVarRef var) {
  if (!var.is(KindOfObject) || getObjAttempted()) {
    return nullptr;
  }
  setObjAttempted();
  ObjectData *obj = var.getObjectData();
  if (obj->instanceof(SystemLib::s_SerializableClass)) {
    // should also check the object itself
    return nullptr;
  }
  PointerSet seen;
  if (obj->hasInternalReference(seen, true)) {
    return nullptr;
  }
  SharedVariant *tmp = new SharedVariant(var, false, true, true);
  tmp->setObjAttempted();
  return tmp;
}
예제 #3
0
SharedVariant* SharedVariant::convertObj(CVarRef var) {
    if (!var.is(KindOfObject) || getObjAttempted()) {
        return NULL;
    }
    setObjAttempted();
    PointerSet seen;
    ObjectData *obj = var.getObjectData();
    if (obj->o_instanceof("Serializable")) {
        // should also check the object itself
        return NULL;
    }
    CArrRef arr = obj->o_toArray();
    if (arr->hasInternalReference(seen, true)) {
        return NULL;
    }
    SharedVariant *tmp = new SharedVariant(var, false, true, true);
    tmp->setObjAttempted();
    return tmp;
}