From 4e8f9a89eef37ea1228dff49f7a38330d2b42633 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 22 Sep 2017 17:03:48 -0400 Subject: [PATCH] Perform bitwise ops on unsigned types Signed-off-by: Mathieu Desnoyers --- liblttng-ust/lttng-filter-interpreter.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/liblttng-ust/lttng-filter-interpreter.c b/liblttng-ust/lttng-filter-interpreter.c index 1354d9c1..753880c3 100644 --- a/liblttng-ust/lttng-filter-interpreter.c +++ b/liblttng-ust/lttng-filter-interpreter.c @@ -1562,7 +1562,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, ret = -EINVAL; goto end; } - res = (estack_bx_v >> estack_ax_v); + res = ((uint64_t) estack_bx_v >> (uint32_t) estack_ax_v); estack_pop(stack, top, ax, bx, ax_t, bx_t); estack_ax_v = res; estack_ax_t = REG_S64; @@ -1583,7 +1583,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, ret = -EINVAL; goto end; } - res = (estack_bx_v << estack_ax_v); + res = ((uint64_t) estack_bx_v << (uint32_t) estack_ax_v); estack_pop(stack, top, ax, bx, ax_t, bx_t); estack_ax_v = res; estack_ax_t = REG_S64; @@ -1600,7 +1600,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, goto end; } - res = (estack_bx_v & estack_ax_v); + res = ((uint64_t) estack_bx_v & (uint64_t) estack_ax_v); estack_pop(stack, top, ax, bx, ax_t, bx_t); estack_ax_v = res; estack_ax_t = REG_S64; @@ -1617,7 +1617,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, goto end; } - res = (estack_bx_v | estack_ax_v); + res = ((uint64_t) estack_bx_v | (uint64_t) estack_ax_v); estack_pop(stack, top, ax, bx, ax_t, bx_t); estack_ax_v = res; estack_ax_t = REG_S64; @@ -1634,7 +1634,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, goto end; } - res = (estack_bx_v ^ estack_ax_v); + res = ((uint64_t) estack_bx_v ^ (uint64_t) estack_ax_v); estack_pop(stack, top, ax, bx, ax_t, bx_t); estack_ax_v = res; estack_ax_t = REG_S64; @@ -1711,7 +1711,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, goto end; } - estack_ax_v = ~estack_ax_v; + estack_ax_v = ~(uint64_t) estack_ax_v; next_pc += sizeof(struct unary_op); PO; } -- 2.34.1