@@ -1905,7 +1905,11 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
1905
1905
out ($ f ,"# define ZEND_OPCODE_HANDLER_RET const zend_op * \n" );
1906
1906
out ($ f ,"# define ZEND_VM_TAIL_CALL(call) return call \n" );
1907
1907
out ($ f ,"# define ZEND_VM_CONTINUE() return opline \n" );
1908
- out ($ f ,"# define ZEND_VM_RETURN() return NULL \n" );
1908
+ out ($ f ,"# ifdef ZEND_HIGH_HALF_KERNEL \n" );
1909
+ out ($ f ,"# define ZEND_VM_RETURN() return NULL \n" );
1910
+ out ($ f ,"# else \n" );
1911
+ out ($ f ,"# define ZEND_VM_RETURN() return ZEND_VM_ENTER_BIT \n" );
1912
+ out ($ f ,"# endif \n" );
1909
1913
if ($ kind == ZEND_VM_KIND_HYBRID ) {
1910
1914
out ($ f ,"# define ZEND_VM_HOT \n" );
1911
1915
}
@@ -1944,7 +1948,11 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
1944
1948
out ($ f ,"# define ZEND_VM_ENTER() opline = EG(current_execute_data)->opline; ZEND_VM_ENTER_EX() \n" );
1945
1949
out ($ f ,"# define ZEND_VM_LEAVE() return 2 \n" );
1946
1950
out ($ f ,"#else \n" );
1947
- out ($ f ,"# define ZEND_VM_ENTER_BIT (1ULL<<(UINTPTR_WIDTH-1)) \n" );
1951
+ out ($ f ,"# ifdef ZEND_HIGH_HALF_KERNEL \n" );
1952
+ out ($ f ,"# define ZEND_VM_ENTER_BIT (1ULL<<(UINTPTR_WIDTH-1)) \n" );
1953
+ out ($ f ,"# else \n" );
1954
+ out ($ f ,"# define ZEND_VM_ENTER_BIT 1ULL \n" );
1955
+ out ($ f ,"# endif \n" );
1948
1956
out ($ f ,"# define ZEND_VM_ENTER_EX() return (zend_op*)((uintptr_t)opline | ZEND_VM_ENTER_BIT) \n" );
1949
1957
out ($ f ,"# define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM_ENTER_EX() \n" );
1950
1958
out ($ f ,"# define ZEND_VM_LEAVE() return (zend_op*)((uintptr_t)opline | ZEND_VM_ENTER_BIT) \n" );
@@ -2147,7 +2155,11 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
2147
2155
out ($ f , $ m [1 ]."if (UNEXPECTED(!OPLINE)) " .$ m [3 ]."\n" );
2148
2156
out ($ f ,"#else \n" );
2149
2157
out ($ f , $ m [1 ]."opline = ((opcode_handler_t)opline->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); \n" );
2150
- out ($ f , $ m [1 ]."if (UNEXPECTED((intptr_t)OPLINE <= 0)) " .$ m [3 ]."\n" );
2158
+ out ($ f , "# ifdef ZEND_HIGH_HALF_KERNEL \n" );
2159
+ out ($ f , $ m [1 ]."if (UNEXPECTED((intptr_t)opline <= 0)) " .$ m [3 ]."\n" );
2160
+ out ($ f , "# else \n" );
2161
+ out ($ f , $ m [1 ]."if (UNEXPECTED(((uintptr_t)opline & ZEND_VM_ENTER_BIT))) " .$ m [3 ]."\n" );
2162
+ out ($ f , "# endif \n" );
2151
2163
out ($ f ,"#endif \n" );
2152
2164
if ($ kind == ZEND_VM_KIND_HYBRID ) {
2153
2165
out ($ f ,"#endif /* ZEND_VM_KIND != ZEND_VM_KIND_HYBRID */ \n" );
@@ -2176,8 +2188,8 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
2176
2188
"# endif \n" .
2177
2189
$ m [1 ]."return; \n" .
2178
2190
"#else \n" .
2179
- $ m [1 ]."if (EXPECTED( opline != NULL && ( uintptr_t)opline != ZEND_VM_ENTER_BIT)) { \n" .
2180
- $ m [1 ]."\t opline = (zend_op*)((uintptr_t) opline & ~ZEND_VM_ENTER_BIT); \n" .
2191
+ $ m [1 ]."opline = (const zend_op*)(( uintptr_t)opline & ~ ZEND_VM_ENTER_BIT); \n" .
2192
+ $ m [1 ]."if (EXPECTED( opline != NULL)) { \n" .
2181
2193
$ m [1 ]."\texecute_data = EG(current_execute_data); \n" .
2182
2194
$ m [1 ]."\tZEND_VM_LOOP_INTERRUPT_CHECK(); \n" .
2183
2195
$ m [1 ]."} else { \n" .
0 commit comments