projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Force usage of assert() condition when NDEBUG is defined
[lttng-tools.git]
/
src
/
common
/
filter
/
filter-visitor-generate-ir.c
diff --git
a/src/common/filter/filter-visitor-generate-ir.c
b/src/common/filter/filter-visitor-generate-ir.c
index 11c6b610c1276893ea4986dd18fc9a090f02fdc4..56aa26d27009e25bcb6fff2bccdbcea8ea329215 100644
(file)
--- a/
src/common/filter/filter-visitor-generate-ir.c
+++ b/
src/common/filter/filter-visitor-generate-ir.c
@@
-13,13
+13,12
@@
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#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 <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>
#include <common/macros.h>
#include <common/string-utils/string-utils.h>
@@
-63,7
+62,7
@@
struct ir_op *make_op_root(struct ir_op *child, enum ir_side side)
static
enum ir_load_string_type get_literal_string_type(const char *string)
{
static
enum ir_load_string_type get_literal_string_type(const char *string)
{
-
assert
(string);
+
LTTNG_ASSERT
(string);
if (strutils_is_star_glob_pattern(string)) {
if (strutils_is_star_at_the_end_only_glob_pattern(string)) {
if (strutils_is_star_glob_pattern(string)) {
if (strutils_is_star_at_the_end_only_glob_pattern(string)) {
@@
-171,7
+170,7
@@
struct filter_node *load_expression_get_forward_chain(struct filter_node *node)
struct filter_node *prev_node;
for (;;) {
struct filter_node *prev_node;
for (;;) {
-
assert
(node->type == NODE_EXPRESSION);
+
LTTNG_ASSERT
(node->type == NODE_EXPRESSION);
prev_node = node;
node = node->u.expression.prev;
if (!node) {
prev_node = node;
node = node->u.expression.prev;
if (!node) {
@@
-244,6
+243,11
@@
struct ir_load_expression *create_load_expression(struct filter_node *node)
bracket_node != NULL;
bracket_node = bracket_node->u.expression.next_bracket) {
prev_op = load_exp_op;
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;
load_exp_op = calloc(sizeof(struct ir_load_expression_op), 1);
if (!load_exp_op)
goto error;
This page took
0.025373 seconds
and
4
git commands to generate.