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 "data.h"
struct psi_free_stmt *psi_free_stmt_init(struct psi_plist *exps)
{
- struct psi_free_stmt *f = calloc(1, sizeof(*f));
+ struct psi_free_stmt *f = pecalloc(1, sizeof(*f), 1);
f->exps = exps;
return f;
}
struct psi_free_stmt *f = *f_ptr;
*f_ptr = NULL;
+ psi_token_free(&f->token);
psi_plist_free(f->exps);
free(f);
}
}
-void psi_free_stmt_dump(int fd, struct psi_free_stmt *fre)
+void psi_free_stmt_dump(struct psi_dump *dump, struct psi_free_stmt *fre)
{
size_t i;
struct psi_free_exp *exp;
- dprintf(fd, "\tfree ");
+ PSI_DUMP(dump, "\tfree ");
for (i = 0; psi_plist_get(fre->exps, i, &exp); ++i) {
if (i) {
- dprintf(fd, ", ");
+ PSI_DUMP(dump, ", ");
}
- psi_free_exp_dump(fd, exp);
+ psi_free_exp_dump(dump, exp);
}
- dprintf(fd, ";\n");
+ PSI_DUMP(dump, ";\n");
}
-bool psi_free_stmts_validate(struct psi_data *data, struct psi_impl *impl)
+bool psi_free_stmts_validate(struct psi_data *data, struct psi_validate_scope *scope)
{
size_t i;
struct psi_free_stmt *fre;
/* we can have any count of free stmts; freeing any out vars */
- for (i = 0; psi_plist_get(impl->stmts.fre, i, &fre); ++i) {
+ for (i = 0; psi_plist_get(scope->impl->stmts.fre, i, &fre); ++i) {
size_t j;
struct psi_free_exp *exp;
for (j = 0; psi_plist_get(fre->exps, j, &exp); ++j) {
- if (!psi_free_exp_validate(data, exp, impl)) {
+ if (!psi_free_exp_validate(data, exp, scope)) {
return false;
}
}