diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-06-16 16:29:05 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-06-16 18:39:09 +0200 |
commit | 92c4b0651368a4135f692af48f4716c96de4bd92 (patch) | |
tree | 052276ba1af9bcf5fd113f9bf8d6d93075d69aa3 /Zend/zend_inheritance.c | |
parent | 9ff3230c20f27ac35788aca72f16ff928a25f81b (diff) | |
download | php-git-92c4b0651368a4135f692af48f4716c96de4bd92.tar.gz |
Use ZEND_UNREACHABLE() instead of ZEND_ASSERT(0)
Instead of marking unreachable code with `ZEND_ASSERT(0)`, we introduce
`ZEND_UNREACHABLE()`, so that MSVC which does not consider `assert(0)`
to mark unreachable code does no longer trigger C4715[1] warnings in
debug builds. This may be useful for other compilers as well.
[1] <https://docs.microsoft.com/de-de/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4715?view=vs-2019>
Diffstat (limited to 'Zend/zend_inheritance.c')
-rw-r--r-- | Zend/zend_inheritance.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 26a2bc4da5..b6a3a891b2 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -1280,7 +1280,7 @@ ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *par zend_class_init_statics(parent_ce); } if (UNEXPECTED(zend_update_class_constants(parent_ce) != SUCCESS)) { - ZEND_ASSERT(0); + ZEND_UNREACHABLE(); } src = CE_STATIC_MEMBERS(parent_ce) + parent_ce->default_static_members_count; do { |