interned strings
[m6w6/ext-psi] / src / context.c
index 995a0010498aa1d11c75f236b57183f130dbf55a..8fdbf22f41a2701b60833ce59407f3c48b078122 100644 (file)
@@ -142,7 +142,7 @@ void psi_context_build(struct psi_context *C, const char *paths)
                                psi_parser_parse(&P, I);
                                psi_context_add(C, &P);
                                psi_parser_dtor(&P);
-                               free(I);
+                               psi_parser_input_free(&I);
                        }
                }
 
@@ -196,6 +196,9 @@ zend_function_entry *psi_context_compile(struct psi_context *C)
                        case PSI_T_STRING:
                        case PSI_T_QUOTED_STRING:
                                ZVAL_NEW_STR(&zc.value, zend_string_copy(c->val->ival.zend.str));
+                               if (ZSTR_IS_INTERNED(Z_STR(zc.value))) {
+                                       Z_TYPE_FLAGS(zc.value) = 0;
+                               }
                                break;
                        default:
                                assert(0);