flush
[m6w6/ext-psi] / src / context.c
index 05d5aacbfc3d1d041957d88b72df257ee35e47f5..134acdd40dd69d8fb454a23535e6db0892f7b7e5 100644 (file)
@@ -439,6 +439,12 @@ static inline int validate_set_value(PSI_Data *data, set_value *set, decl_arg *r
        case PSI_T_TO_ARRAY:
                set->func->handler = psi_to_array;
                break;
+       case PSI_T_TO_OBJECT:
+               set->func->handler = psi_to_object;
+               break;
+       case PSI_T_VOID:
+               set->func->handler = psi_to_void;
+               break;
        EMPTY_SWITCH_DEFAULT_CASE();
        }
 
@@ -960,9 +966,13 @@ void PSI_ContextBuild(PSI_Context *C, const char *paths)
                                        continue;
                                }
 
-                               while (-1 != PSI_ParserScan(&P)) {
+                               while (0 < PSI_ParserScan(&P)) {
                                        PSI_ParserParse(&P, PSI_TokenAlloc(&P));
-                               };
+                                       if (P.num == PSI_T_EOF) {
+                                               break;
+                                       }
+                               }
+
                                PSI_ParserParse(&P, NULL);
                                PSI_ContextValidate(C, &P);
                                PSI_ParserDtor(&P);
@@ -1025,6 +1035,7 @@ zend_function_entry *PSI_ContextCompile(PSI_Context *C)
 
 void PSI_ContextCall(PSI_Context *C, impl_val *ret_val, decl *decl)
 {
+       errno = 0;
        C->ops->call(C, ret_val, decl);
 }