fix gpr_stack_lockfree_test assert bug on 64 bits

pull/4484/head
Konstantinos Sofokleous 9 years ago
parent 80428e6d1c
commit 147cc70dd6
  1. 8
      src/core/support/stack_lockfree.c

@ -128,8 +128,8 @@ int gpr_stack_lockfree_push(gpr_stack_lockfree *stack, int entry) {
gpr_atm old_val;
old_val = gpr_atm_no_barrier_fetch_add(&stack->pushed[pushed_index],
(gpr_atm)(1UL << pushed_bit));
GPR_ASSERT((old_val & (gpr_atm)(1UL << pushed_bit)) == 0);
((gpr_atm)1 << pushed_bit));
GPR_ASSERT((old_val & ((gpr_atm)1 << pushed_bit)) == 0);
}
#endif
@ -166,8 +166,8 @@ int gpr_stack_lockfree_pop(gpr_stack_lockfree *stack) {
gpr_atm old_val;
old_val = gpr_atm_no_barrier_fetch_add(&stack->pushed[pushed_index],
-(gpr_atm)(1UL << pushed_bit));
GPR_ASSERT((old_val & (gpr_atm)(1UL << pushed_bit)) != 0);
-((gpr_atm)1 << pushed_bit));
GPR_ASSERT((old_val & ((gpr_atm)1 << pushed_bit)) != 0);
}
#endif

Loading…
Cancel
Save