projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
flush
[m6w6/ext-psi]
/
src
/
libjit.c
diff --git
a/src/libjit.c
b/src/libjit.c
index 4866809392aafea74425e6f7d9e36c812b2f67f7..45ee8e766c34a8153439cee6351cb4617c4782ee 100644
(file)
--- a/
src/libjit.c
+++ b/
src/libjit.c
@@
-1,4
+1,11
@@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include "php.h"
#include "php.h"
+
+#ifdef HAVE_LIBJIT
+
#include "php_psi.h"
#include "libjit.h"
#include "php_psi.h"
#include "libjit.h"
@@
-11,9
+18,6
@@
static inline jit_abi_t psi_jit_abi(const char *convention) {
}
static inline jit_type_t psi_jit_token_type(token_t t) {
switch (t) {
}
static inline jit_type_t psi_jit_token_type(token_t t) {
switch (t) {
- default:
- ZEND_ASSERT(0);
- /* no break */
case PSI_T_VOID:
return jit_type_void;
case PSI_T_INT8:
case PSI_T_VOID:
return jit_type_void;
case PSI_T_INT8:
@@
-34,12
+38,11
@@
static inline jit_type_t psi_jit_token_type(token_t t) {
return jit_type_ulong;
case PSI_T_BOOL:
return jit_type_sys_bool;
return jit_type_ulong;
case PSI_T_BOOL:
return jit_type_sys_bool;
- case PSI_T_INT:
- return jit_type_sys_int;
case PSI_T_FLOAT:
return jit_type_sys_float;
case PSI_T_DOUBLE:
return jit_type_sys_double;
case PSI_T_FLOAT:
return jit_type_sys_float;
case PSI_T_DOUBLE:
return jit_type_sys_double;
+ EMPTY_SWITCH_DEFAULT_CASE();
}
}
static inline jit_type_t psi_jit_decl_type(decl_type *type) {
}
}
static inline jit_type_t psi_jit_decl_type(decl_type *type) {
@@
-146,12
+149,14
@@
static void psi_jit_init(PSI_Context *C)
static void psi_jit_dtor(PSI_Context *C)
{
static void psi_jit_dtor(PSI_Context *C)
{
- size_t i;
+ if (C->decls) {
+ size_t i;
- for (i = 0; i < C->decls->count; ++i) {
- decl *decl = C->decls->list[i];
+
for (i = 0; i < C->decls->count; ++i) {
+
decl *decl = C->decls->list[i];
- PSI_LibjitCallFree(decl->call.info);
+ PSI_LibjitCallFree(decl->call.info);
+ }
}
PSI_LibjitContextFree((void *) &C->context);
}
}
PSI_LibjitContextFree((void *) &C->context);
}
@@
-221,3
+226,5
@@
PSI_ContextOps *PSI_Libjit(void)
{
return &ops;
}
{
return &ops;
}
+
+#endif /* HAVE_LIBJIT */