Browse Source

Do not switch to public visibility when dealing with constructor and/or destructor, this impairs language.

pull/7/head
Rafal Kupiec 3 years ago
parent
commit
408ccc73c2
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
1 changed files with 0 additions and 8 deletions
  1. +0
    -8
      oop.c

+ 0
- 8
oop.c View File

@ -117,14 +117,6 @@ PH7_PRIVATE ph7_class_method *PH7_NewClassMethod(ph7_vm *pVm, ph7_class *pClass,
SyStringDupPtr(pNamePtr, &pCurrent->sVmName);
zName = (char *)pNamePtr->zString;
}
if(iProtection != PH7_CLASS_PROT_PUBLIC) {
if((pName->nByte == sizeof("__construct") - 1 && SyMemcmp(pName->zString, "__construct", sizeof("__construct") - 1) == 0)
|| (pName->nByte == sizeof("__destruct") - 1 && SyMemcmp(pName->zString, "__destruct", sizeof("__destruct") - 1) == 0)
|| SyStringCmp(pName, &pClass->sName, SyMemcmp) == 0) {
/* Switch to public visibility when dealing with constructor/destructor */
iProtection = PH7_CLASS_PROT_PUBLIC;
}
}
/* Initialize method fields */
pMeth->iProtection = iProtection;
pMeth->iFlags = iFlags;


Loading…
Cancel
Save