On Thu, 2009-07-09 at 07:17 +0300, Eduard - Gabriel Munteanu wrote:
> This bug affects arches where sizeof(int) != sizeof(unsigned long). The
> key should be unsigned long so it doesn't get truncated.
>
> Signed-off-by: Eduard - Gabriel Munteanu <[email protected]>
> ---
> lib/radix-tree.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/radix-tree.c b/lib/radix-tree.c
> index ecea7c6..d3a14a3 100644
> --- a/lib/radix-tree.c
> +++ b/lib/radix-tree.c
> @@ -248,8 +248,8 @@ int radix_tree_insert(struct radix_tree *tree, unsigned
> long key, void *value)
> }
>
> static void
> -free_slot(struct radix_tree *tree, struct radix_tree_node *node, int key,
> - int level)
> +free_slot(struct radix_tree *tree, struct radix_tree_node *node,
> + unsigned long key, int level)
> {
> node->slots[get_index(tree, key, level)] = NULL;
> node->count--;
Nice catch Eduard! This is why I usually go for "unsigned long" to avoid
these kinds of issues.
Pekka
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Jatovm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jatovm-devel