summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2006-08-07 23:24:33 +0000
committerMarcus Boerger <helly@php.net>2006-08-07 23:24:33 +0000
commitc1c2a0d294cefc136d7eff00b6ef2e60c7ad7f8e (patch)
tree83cb9263d34a4aa2cd671acbc7076f7162426b25 /Zend
parent886d302575b64a53a9e80c0cf40a9cef37c46115 (diff)
downloadphp-git-c1c2a0d294cefc136d7eff00b6ef2e60c7ad7f8e.tar.gz
- MFH Fixed Bug #38064 ignored constructor visibility
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_vm_def.h3
-rw-r--r--Zend/zend_vm_execute.h15
2 files changed, 18 insertions, 0 deletions
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 64c3084816..57d5dd4567 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -1763,6 +1763,9 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, ANY, CONST|TMP|VAR|UNUSED|CV)
if(!ce->constructor) {
zend_error_noreturn(E_ERROR, "Can not call constructor");
}
+ if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+ zend_error(E_COMPILE_ERROR, "Cannot call private %s::__constrcut()", ce->name);
+ }
EX(fbc) = ce->constructor;
}
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index ed5b13cc4c..111cd42ffa 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -670,6 +670,9 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
if(!ce->constructor) {
zend_error_noreturn(E_ERROR, "Can not call constructor");
}
+ if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE) {
+ zend_error(E_COMPILE_ERROR, "Cannot call private %s::__constrcut()", ce->name);
+ }
EX(fbc) = ce->constructor;
}
@@ -871,6 +874,9 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
if(!ce->constructor) {
zend_error_noreturn(E_ERROR, "Can not call constructor");
}
+ if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE) {
+ zend_error(E_COMPILE_ERROR, "Cannot call private %s::__constrcut()", ce->name);
+ }
EX(fbc) = ce->constructor;
}
@@ -1029,6 +1035,9 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
if(!ce->constructor) {
zend_error_noreturn(E_ERROR, "Can not call constructor");
}
+ if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE) {
+ zend_error(E_COMPILE_ERROR, "Cannot call private %s::__constrcut()", ce->name);
+ }
EX(fbc) = ce->constructor;
}
@@ -1186,6 +1195,9 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_
if(!ce->constructor) {
zend_error_noreturn(E_ERROR, "Can not call constructor");
}
+ if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE) {
+ zend_error(E_COMPILE_ERROR, "Cannot call private %s::__constrcut()", ce->name);
+ }
EX(fbc) = ce->constructor;
}
@@ -1276,6 +1288,9 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if(!ce->constructor) {
zend_error_noreturn(E_ERROR, "Can not call constructor");
}
+ if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE) {
+ zend_error(E_COMPILE_ERROR, "Cannot call private %s::__constrcut()", ce->name);
+ }
EX(fbc) = ce->constructor;
}