Skip to content
Snippets Groups Projects
Commit 147cc70d authored by Konstantinos Sofokleous's avatar Konstantinos Sofokleous
Browse files

fix gpr_stack_lockfree_test assert bug on 64 bits

parent 80428e6d
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment