From: Mathieu Desnoyers Date: Fri, 22 Sep 2017 21:03:48 +0000 (-0400) Subject: Perform bitwise ops on unsigned types X-Git-Tag: v2.11.0-rc1~9 X-Git-Url: http://git.liburcu.org/?p=lttng-ust.git;a=commitdiff_plain;h=4e8f9a89eef37ea1228dff49f7a38330d2b42633 Perform bitwise ops on unsigned types Signed-off-by: Mathieu Desnoyers --- 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; }