diff --git a/ext/annotations/base.c b/ext/annotations/base.c index 06feab31885..df1da1ba19f 100644 --- a/ext/annotations/base.c +++ b/ext/annotations/base.c @@ -79,7 +79,7 @@ static void phannot_scanner_error_msg(phannot_parser_status *parser_status, zval char *error, *error_part; phannot_scanner_state *state = parser_status->scanner_state; - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); if (state->start) { error_length = 128 + state->start_length + Z_STRLEN_P(state->active_file); error = emalloc(sizeof(char) * error_length); @@ -377,7 +377,7 @@ int phannot_internal_parse_annotations(zval **result, zval *comment, zval *file_ error = emalloc(error_length); snprintf(error, error_length - 1, "Scanner: unknown opcode %d on in %s line %d", token.opcode, Z_STRVAL_P(state->active_file), state->active_line); error[error_length - 1] = '\0'; - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, error, 1); efree(error); } @@ -413,7 +413,7 @@ int phannot_internal_parse_annotations(zval **result, zval *comment, zval *file_ status = FAILURE; if (parser_status->syntax_error) { if (!*error_msg) { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, parser_status->syntax_error, 1); } efree(parser_status->syntax_error); diff --git a/ext/annotations/parser.c b/ext/annotations/parser.c index d4c234864ff..b25d7696a1d 100644 --- a/ext/annotations/parser.c +++ b/ext/annotations/parser.c @@ -1267,7 +1267,7 @@ static void phannot_scanner_error_msg(phannot_parser_status *parser_status, zval char *error, *error_part; phannot_scanner_state *state = parser_status->scanner_state; - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); if (state->start) { error_length = 128 + state->start_length + Z_STRLEN_P(state->active_file); error = emalloc(sizeof(char) * error_length); @@ -1571,7 +1571,7 @@ int phannot_internal_parse_annotations(zval **result, zval *comment, zval *file_ error = emalloc(error_length); snprintf(error, error_length - 1, "Scanner: unknown opcode %d on in %s line %d", token.opcode, Z_STRVAL_P(state->active_file), state->active_line); error[error_length - 1] = '\0'; - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, error, 1); efree(error); } @@ -1607,7 +1607,7 @@ int phannot_internal_parse_annotations(zval **result, zval *comment, zval *file_ status = FAILURE; if (parser_status->syntax_error) { if (!*error_msg) { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, parser_status->syntax_error, 1); } efree(parser_status->syntax_error); diff --git a/ext/mvc/model/query/base.c b/ext/mvc/model/query/base.c index 148d448bf02..9cfd7e4aa88 100644 --- a/ext/mvc/model/query/base.c +++ b/ext/mvc/model/query/base.c @@ -121,7 +121,7 @@ PHALCON_ATTR_NONNULL static void phql_scanner_error_msg(phql_parser_status *pars unsigned int length; phql_scanner_state *state = parser_status->scanner_state; - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); if (state->start) { length = 64 + state->start_length + parser_status->phql_length; error = emalloc(sizeof(char) * length); @@ -182,7 +182,7 @@ PHALCON_ATTR_NONNULL2(1, 4) int phql_internal_parse_phql(zval **result, char *ph zval **temp_ast; if (!phql) { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, "PHQL statement cannot be NULL", 1); return FAILURE; } @@ -203,7 +203,7 @@ PHALCON_ATTR_NONNULL2(1, 4) int phql_internal_parse_phql(zval **result, char *ph phql_parser = phql_Alloc(phql_wrapper_alloc); if (unlikely(!phql_parser)) { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, "Memory allocation error", 1); return FAILURE; } @@ -325,7 +325,7 @@ PHALCON_ATTR_NONNULL2(1, 4) int phql_internal_parse_phql(zval **result, char *ph if (parser_status->enable_literals) { phql_parse_with_token(phql_parser, PHQL_T_INTEGER, PHQL_INTEGER, &token, parser_status); } else { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, "Literals are disabled in PHQL statements", 1); parser_status->status = PHQL_PARSING_FAILED; } @@ -334,7 +334,7 @@ PHALCON_ATTR_NONNULL2(1, 4) int phql_internal_parse_phql(zval **result, char *ph if (parser_status->enable_literals) { phql_parse_with_token(phql_parser, PHQL_T_DOUBLE, PHQL_DOUBLE, &token, parser_status); } else { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, "Literals are disabled in PHQL statements", 1); parser_status->status = PHQL_PARSING_FAILED; } @@ -343,7 +343,7 @@ PHALCON_ATTR_NONNULL2(1, 4) int phql_internal_parse_phql(zval **result, char *ph if (parser_status->enable_literals) { phql_parse_with_token(phql_parser, PHQL_T_STRING, PHQL_STRING, &token, parser_status); } else { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, "Literals are disabled in PHQL statements", 1); parser_status->status = PHQL_PARSING_FAILED; } @@ -352,7 +352,7 @@ PHALCON_ATTR_NONNULL2(1, 4) int phql_internal_parse_phql(zval **result, char *ph if (parser_status->enable_literals) { phql_(phql_parser, PHQL_TRUE, NULL, parser_status); } else { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, "Literals are disabled in PHQL statements", 1); parser_status->status = PHQL_PARSING_FAILED; } @@ -361,7 +361,7 @@ PHALCON_ATTR_NONNULL2(1, 4) int phql_internal_parse_phql(zval **result, char *ph if (parser_status->enable_literals) { phql_(phql_parser, PHQL_FALSE, NULL, parser_status); } else { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, "Literals are disabled in PHQL statements", 1); parser_status->status = PHQL_PARSING_FAILED; } @@ -488,7 +488,7 @@ PHALCON_ATTR_NONNULL2(1, 4) int phql_internal_parse_phql(zval **result, char *ph error = emalloc(error_length); snprintf(error, error_length, "Scanner: Unknown opcode %c", token.opcode); error[error_length - 1] = '\0'; - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, error, 1); efree(error); break; @@ -525,7 +525,7 @@ PHALCON_ATTR_NONNULL2(1, 4) int phql_internal_parse_phql(zval **result, char *ph status = FAILURE; if (parser_status->syntax_error) { if (!*error_msg) { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, parser_status->syntax_error, 1); } efree(parser_status->syntax_error); diff --git a/ext/mvc/model/query/parser.c b/ext/mvc/model/query/parser.c index 2e41af34823..68c211ef9a2 100644 --- a/ext/mvc/model/query/parser.c +++ b/ext/mvc/model/query/parser.c @@ -2779,7 +2779,7 @@ PHALCON_ATTR_NONNULL static void phql_scanner_error_msg(phql_parser_status *pars unsigned int length; phql_scanner_state *state = parser_status->scanner_state; - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); if (state->start) { length = 64 + state->start_length + parser_status->phql_length; error = emalloc(sizeof(char) * length); @@ -2813,6 +2813,7 @@ PHALCON_ATTR_NONNULL int phql_parse_phql(zval *result, zval *phql TSRMLS_DC) { if (phql_internal_parse_phql(&result, Z_STRVAL_P(phql), Z_STRLEN_P(phql), &error_msg TSRMLS_CC) == FAILURE) { if (likely(error_msg != NULL)) { PHALCON_THROW_EXCEPTION_STRW(phalcon_mvc_model_exception_ce, Z_STRVAL_P(error_msg)); + zval_ptr_dtor(&error_msg); } else { PHALCON_THROW_EXCEPTION_STRW(phalcon_mvc_model_exception_ce, "There was an error parsing PHQL"); @@ -2840,7 +2841,7 @@ int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql_length zval **temp_ast; if (!phql) { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, "PHQL statement cannot be NULL", 1); return FAILURE; } @@ -2861,7 +2862,7 @@ int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql_length phql_parser = phql_Alloc(phql_wrapper_alloc); if (unlikely(!phql_parser)) { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, "Memory allocation error", 1); return FAILURE; } @@ -2983,7 +2984,7 @@ int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql_length if (parser_status->enable_literals) { phql_parse_with_token(phql_parser, PHQL_T_INTEGER, PHQL_INTEGER, &token, parser_status); } else { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, "Literals are disabled in PHQL statements", 1); parser_status->status = PHQL_PARSING_FAILED; } @@ -2992,7 +2993,7 @@ int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql_length if (parser_status->enable_literals) { phql_parse_with_token(phql_parser, PHQL_T_DOUBLE, PHQL_DOUBLE, &token, parser_status); } else { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, "Literals are disabled in PHQL statements", 1); parser_status->status = PHQL_PARSING_FAILED; } @@ -3001,7 +3002,7 @@ int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql_length if (parser_status->enable_literals) { phql_parse_with_token(phql_parser, PHQL_T_STRING, PHQL_STRING, &token, parser_status); } else { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, "Literals are disabled in PHQL statements", 1); parser_status->status = PHQL_PARSING_FAILED; } @@ -3010,7 +3011,7 @@ int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql_length if (parser_status->enable_literals) { phql_(phql_parser, PHQL_TRUE, NULL, parser_status); } else { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, "Literals are disabled in PHQL statements", 1); parser_status->status = PHQL_PARSING_FAILED; } @@ -3019,7 +3020,7 @@ int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql_length if (parser_status->enable_literals) { phql_(phql_parser, PHQL_FALSE, NULL, parser_status); } else { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, "Literals are disabled in PHQL statements", 1); parser_status->status = PHQL_PARSING_FAILED; } @@ -3146,7 +3147,7 @@ int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql_length error = emalloc(error_length); snprintf(error, error_length, "Scanner: Unknown opcode %c", token.opcode); error[error_length - 1] = '\0'; - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, error, 1); efree(error); break; @@ -3183,7 +3184,7 @@ int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql_length status = FAILURE; if (parser_status->syntax_error) { if (!*error_msg) { - PHALCON_INIT_VAR(*error_msg); + MAKE_STD_ZVAL(*error_msg); ZVAL_STRING(*error_msg, parser_status->syntax_error, 1); } efree(parser_status->syntax_error);