fix build
[m6w6/ext-psi] / src / call.c
index c5aa4b7b7c624f92e5f5427cf4d6cef92a711f1e..a46fa4e325196c26edb2e06e9989facb81f5524d 100644 (file)
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *******************************************************************************/
 
-#include "php_psi_stdinc.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#else
+# include "php_config.h"
+#endif
 #include "context.h"
 #include "data.h"
 #include "call.h"
 
 #include "php.h"
 #include "zend_exceptions.h"
-#include "ext/spl/spl_exceptions.h"
 
 struct psi_call_frame_argument *psi_call_frame_argument_init(struct psi_impl_arg *spec,
                impl_val *ival, zval *zptr, int is_vararg) {
@@ -199,7 +202,7 @@ zval *psi_call_frame_sub_argument(struct psi_call_frame *frame,
        if (!iarg) {
                struct psi_call_frame_argument *frame_arg;
                impl_val empty_val = {0};
-               zend_string *type_str = zend_string_init(ZEND_STRL("mixed"), 1);
+               zend_string *type_str = psi_string_init_interned(ZEND_STRL("mixed"), 1);
                struct psi_impl_arg *carg_spec = psi_impl_arg_init(
                                psi_impl_type_init(PSI_T_MIXED, type_str),
                                psi_impl_var_copy(inner_var), NULL);
@@ -427,11 +430,7 @@ ZEND_RESULT_CODE psi_call_frame_do_assert(struct psi_call_frame *frame, enum psi
        while (psi_plist_get(frame->impl->stmts.ass, i++, &ass)) {
                if (ass->kind == kind) {
                        if (!psi_assert_stmt_exec(ass, frame)) {
-                               char *message = psi_assert_stmt_message(ass);
-                               zend_throw_exception(kind == PSI_ASSERT_PRE
-                                               ? spl_ce_InvalidArgumentException
-                                               : spl_ce_UnexpectedValueException, message, 0);
-                               free(message);
+                               psi_assert_stmt_throw(ass);
                                return FAILURE;
                        }
                }
@@ -477,6 +476,7 @@ void psi_call_frame_do_callback(struct psi_call_frame *frame, struct psi_call_fr
        rc = zend_fcall_info_call(&frame_arg->ival_ptr->zend.cb->fci,
                        &frame_arg->ival_ptr->zend.cb->fcc,     &return_value, NULL);
        assert(rc == SUCCESS);
+       (void) rc;
 
        /* marshal return value of the userland call */
        frame_arg->zval_ptr = &return_value;