Force usage of assert() condition when NDEBUG is defined
[lttng-tools.git] / src / common / filter / filter-parser.y
index 245d83c26bd99c859c62fc9e59dc5235254f4f9a..d2c726007d1043d59c0ec7fefb1e0e244894a532 100644 (file)
 #include <unistd.h>
 #include <string.h>
 #include <stdlib.h>
-#include <assert.h>
-#include <errno.h>
 #include <inttypes.h>
+#include "common/bytecode/bytecode.h"
 #include "filter-ast.h"
 #include "filter-parser.h"
-#include "filter-bytecode.h"
 #include "memstream.h"
 
+#include <common/compat/errno.h>
 #include <common/macros.h>
 
 #define WIDTH_u64_SCANF_IS_A_BROKEN_API        "20"
@@ -296,11 +295,16 @@ void filter_parser_ctx_free(struct filter_parser_ctx *parser_ctx)
 {
        int ret;
 
-       free_strings(&parser_ctx->allocated_strings);
-       filter_ast_free(parser_ctx->ast);
        ret = yylex_destroy(parser_ctx->scanner);
        if (ret)
                fprintf(stderr, "yylex_destroy error\n");
+
+       filter_ast_free(parser_ctx->ast);
+       free_strings(&parser_ctx->allocated_strings);
+       filter_ir_free(parser_ctx);
+       free(parser_ctx->bytecode);
+       free(parser_ctx->bytecode_reloc);
+
        free(parser_ctx);
 }
 
@@ -312,8 +316,8 @@ int filter_parser_ctx_create_from_filter_expression(
        struct filter_parser_ctx *ctx = NULL;
        FILE *fmem = NULL;
 
-       assert(filter_expression);
-       assert(ctxp);
+       LTTNG_ASSERT(filter_expression);
+       LTTNG_ASSERT(ctxp);
 
        /*
         * Casting const to non-const, as the underlying function will use it in
This page took 0.025104 seconds and 4 git commands to generate.