#include <string.h>
#include <stdlib.h>
#include <assert.h>
-#include <errno.h>
#include <inttypes.h>
#include "filter-ast.h"
#include "filter-parser.h"
#include "filter-ir.h"
+#include <common/compat/errno.h>
#include <common/macros.h>
#include <common/string-utils/string-utils.h>
bracket_node != NULL;
bracket_node = bracket_node->u.expression.next_bracket) {
prev_op = load_exp_op;
+ if (bracket_node->type != NODE_EXPRESSION ||
+ bracket_node->u.expression.type != AST_EXP_CONSTANT) {
+ fprintf(stderr, "[error] Expecting constant index in array expression\n");
+ goto error;
+ }
load_exp_op = calloc(sizeof(struct ir_load_expression_op), 1);
if (!load_exp_op)
goto error;