fix retval
authorMichael Wallner <mike@php.net>
Wed, 18 Nov 2015 17:22:57 +0000 (18:22 +0100)
committerMichael Wallner <mike@php.net>
Wed, 18 Nov 2015 17:22:57 +0000 (18:22 +0100)
psis/time.psi
src/libjit.c
src/module.c

index e49118545a9fae248e10e3b15d54b1729cfa884a..1281c51d988867b3eb624fdb3266e83ce4ae2423 100644 (file)
@@ -1,3 +1,9 @@
+extern time_t time(time_t *t);
+function psi\time() : int {
+       let t = NULL;
+       return to_int(time);
+}
+
 extern int gettimeofday(struct timeval *tv, struct timezone *tz);
 function psi\gettimeofday(array &$tv = NULL, array &$tz = NULL) : int {
        let tv = calloc(1, struct timeval);
index 4866809392aafea74425e6f7d9e36c812b2f67f7..736b54dbbbd67e7a2a61b12b44b9cba7934d90b3 100644 (file)
@@ -11,9 +11,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) {
-       default:
-               ZEND_ASSERT(0);
-               /* no break */
        case PSI_T_VOID:
                return jit_type_void;
        case PSI_T_INT8:
@@ -34,12 +31,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;
-       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;
+       EMPTY_SWITCH_DEFAULT_CASE();
        }
 }
 static inline jit_type_t psi_jit_decl_type(decl_type *type) {
index 8ab22ae1b2133e847c9d43866beb8f195ec3cc14..b7a09c3d5b81f9b6f51e976b12374cfecedd89be 100644 (file)
@@ -685,6 +685,7 @@ void psi_call(zend_execute_data *execute_data, zval *return_value, impl *impl)
                }
        }
 
+       memset(&ret_val, 0, sizeof(ret_val));
        PSI_ContextCall(&PSI_G(context), &ret_val, impl->decl);
 
        psi_do_return(return_value, impl->stmts->ret.list[0], &ret_val);