summaryrefslogtreecommitdiff
path: root/sapi/fuzzer
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-08-28 17:03:54 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-08-28 17:03:54 +0200
commitf0dfdca0ae67940ce23703a2354b4fca08e4eab8 (patch)
treefad7faa07fffec8827f702cd54d70804a4d6d3b2 /sapi/fuzzer
parent2c15c9ce80b0c8779a3d5cc5ad1c3452e620d084 (diff)
downloadphp-git-f0dfdca0ae67940ce23703a2354b4fca08e4eab8.tar.gz
Fix execute fuzzer on i386
Opcode handlers use the FASTCALL calling convention...
Diffstat (limited to 'sapi/fuzzer')
-rw-r--r--sapi/fuzzer/fuzzer-execute.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sapi/fuzzer/fuzzer-execute.c b/sapi/fuzzer/fuzzer-execute.c
index bc903bbe63..f9faf90dea 100644
--- a/sapi/fuzzer/fuzzer-execute.c
+++ b/sapi/fuzzer/fuzzer-execute.c
@@ -22,6 +22,10 @@
#define MAX_STEPS 1000
static uint32_t steps_left;
+/* Because the fuzzer is always compiled with clang,
+ * we can assume that we don't use global registers / hybrid VM. */
+typedef int (ZEND_FASTCALL *opcode_handler_t)(zend_execute_data *);
+
void fuzzer_execute_ex(zend_execute_data *execute_data) {
while (1) {
int ret;
@@ -32,7 +36,7 @@ void fuzzer_execute_ex(zend_execute_data *execute_data) {
zend_bailout();
}
- if ((ret = ((user_opcode_handler_t) EX(opline)->handler)(execute_data)) != 0) {
+ if ((ret = ((opcode_handler_t) EX(opline)->handler)(execute_data)) != 0) {
if (ret > 0) {
execute_data = EG(current_execute_data);
} else {