X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=liblttng-ust%2Flttng-filter-interpreter.c;h=df4add225dbb2585548b6bcb740a4aaa026772b8;hb=89f26d57d2880f83c9fee7fbc6ec870d1def0d2c;hp=1f43decee2e32414cb71b3f06e2cd2e9d3afbbaf;hpb=77aa5901fd3f09001fb7e78f3533cf58c6d345e5;p=lttng-ust.git diff --git a/liblttng-ust/lttng-filter-interpreter.c b/liblttng-ust/lttng-filter-interpreter.c index 1f43dece..df4add22 100644 --- a/liblttng-ust/lttng-filter-interpreter.c +++ b/liblttng-ust/lttng-filter-interpreter.c @@ -58,8 +58,8 @@ int stack_strcmp(struct estack *stack, int top, const char *cmp_type) for (;;) { int escaped_r0 = 0; - if (unlikely(p - estack_bx(stack, top)->u.s.str > estack_bx(stack, top)->u.s.seq_len || *p == '\0')) { - if (q - estack_ax(stack, top)->u.s.str > estack_ax(stack, top)->u.s.seq_len || *q == '\0') { + if (unlikely(p - estack_bx(stack, top)->u.s.str >= estack_bx(stack, top)->u.s.seq_len || *p == '\0')) { + if (q - estack_ax(stack, top)->u.s.str >= estack_ax(stack, top)->u.s.seq_len || *q == '\0') { return 0; } else { if (estack_ax(stack, top)->u.s.literal) { @@ -70,8 +70,8 @@ int stack_strcmp(struct estack *stack, int top, const char *cmp_type) return -1; } } - if (unlikely(q - estack_ax(stack, top)->u.s.str > estack_ax(stack, top)->u.s.seq_len || *q == '\0')) { - if (p - estack_bx(stack, top)->u.s.str > estack_bx(stack, top)->u.s.seq_len || *p == '\0') { + if (unlikely(q - estack_ax(stack, top)->u.s.str >= estack_ax(stack, top)->u.s.seq_len || *q == '\0')) { + if (p - estack_bx(stack, top)->u.s.str >= estack_bx(stack, top)->u.s.seq_len || *p == '\0') { return 0; } else { if (estack_bx(stack, top)->u.s.literal) { @@ -176,7 +176,6 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, const char *filter_stack_data) { struct bytecode_runtime *bytecode = filter_data; - struct lttng_ctx *ctx = bytecode->p.bc->enabler->chan->ctx; void *pc, *next_pc, *start_pc; int ret = -EINVAL; uint64_t retval = 0; @@ -864,7 +863,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, dbg_printf("get context ref offset %u type string\n", ref->offset); - ctx_field = &ctx->fields[ref->offset]; + ctx_field = <tng_static_ctx->fields[ref->offset]; ctx_field->get_value(ctx_field, &v); estack_push(stack, top, ax, bx); estack_ax(stack, top)->u.s.str = v.str; @@ -889,7 +888,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, dbg_printf("get context ref offset %u type s64\n", ref->offset); - ctx_field = &ctx->fields[ref->offset]; + ctx_field = <tng_static_ctx->fields[ref->offset]; ctx_field->get_value(ctx_field, &v); estack_push(stack, top, ax, bx); estack_ax_v = v.s64; @@ -907,7 +906,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, dbg_printf("get context ref offset %u type double\n", ref->offset); - ctx_field = &ctx->fields[ref->offset]; + ctx_field = <tng_static_ctx->fields[ref->offset]; ctx_field->get_value(ctx_field, &v); estack_push(stack, top, ax, bx); memcpy(&estack_ax(stack, top)->u.d, &v.d, sizeof(struct literal_double));