mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Assert that cpuinfo is initialized before use
And fix some incorrect indentation.
This commit is contained in:
parent
4a7ebb6d83
commit
f35b194029
2 changed files with 4 additions and 3 deletions
|
@ -99,6 +99,7 @@ void zend_cpu_startup(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
ZEND_API int zend_cpu_supports(zend_cpu_feature feature) {
|
ZEND_API int zend_cpu_supports(zend_cpu_feature feature) {
|
||||||
|
ZEND_ASSERT(cpuinfo.initialized);
|
||||||
if (feature & ZEND_CPU_EDX_MASK) {
|
if (feature & ZEND_CPU_EDX_MASK) {
|
||||||
return (cpuinfo.edx & (feature & ~ZEND_CPU_EDX_MASK));
|
return (cpuinfo.edx & (feature & ~ZEND_CPU_EDX_MASK));
|
||||||
} else if (feature & ZEND_CPU_EBX_MASK) {
|
} else if (feature & ZEND_CPU_EBX_MASK) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue