Skip to content
Snippets Groups Projects
Commit 9e38c21b authored by Craig Tiller's avatar Craig Tiller
Browse files

Merge pull request #4484 from alfatraining/fix_test/gpr_stack_lockfree_test

fix gpr_stack_lockfree_test assert bug on 64 bits
parents aff6d610 1ce471a6
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) { ...@@ -128,8 +128,8 @@ int gpr_stack_lockfree_push(gpr_stack_lockfree *stack, int entry) {
gpr_atm old_val; gpr_atm old_val;
old_val = gpr_atm_no_barrier_fetch_add(&stack->pushed[pushed_index], old_val = gpr_atm_no_barrier_fetch_add(&stack->pushed[pushed_index],
(gpr_atm)(1UL << pushed_bit)); ((gpr_atm)1 << pushed_bit));
GPR_ASSERT((old_val & (gpr_atm)(1UL << pushed_bit)) == 0); GPR_ASSERT((old_val & (((gpr_atm)1) << pushed_bit)) == 0);
} }
#endif #endif
...@@ -166,8 +166,8 @@ int gpr_stack_lockfree_pop(gpr_stack_lockfree *stack) { ...@@ -166,8 +166,8 @@ int gpr_stack_lockfree_pop(gpr_stack_lockfree *stack) {
gpr_atm old_val; gpr_atm old_val;
old_val = gpr_atm_no_barrier_fetch_add(&stack->pushed[pushed_index], old_val = gpr_atm_no_barrier_fetch_add(&stack->pushed[pushed_index],
-(gpr_atm)(1UL << pushed_bit)); -((gpr_atm)1 << pushed_bit));
GPR_ASSERT((old_val & (gpr_atm)(1UL << pushed_bit)) != 0); GPR_ASSERT((old_val & (((gpr_atm)1) << pushed_bit)) != 0);
} }
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment