[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Dotgnu-libjit] [Patch] Type conversion bug
From: |
Klaus Treichel |
Subject: |
Re: [Dotgnu-libjit] [Patch] Type conversion bug |
Date: |
Wed, 13 Oct 2010 19:22:58 +0200 |
Hi Michele,
Am Mittwoch, den 13.10.2010, 15:28 +0200 schrieb Michele Tartara:
> I think I found a bug in the conversion of values from int32 to uint64.
>
> Here is the patch that fixes the problem:
>
> === modified file 'jit/jit-insn.c'
> --- jit/jit-insn.c 2010-10-11 20:32:32 +0000
> +++ jit/jit-insn.c 2010-10-13 09:32:18 +0000
> @@ -4380,7 +4380,7 @@
> /* from signed byte */
> /* from signed short */
> /* from signed int */
> - { CVT(JIT_OP_EXPAND_INT, ulong),
> + { CVT(JIT_OP_EXPAND_UINT, ulong),
> CVT_NONE,
> CVT_NONE },
> { CVT(JIT_OP_CHECK_UINT, uint),
>
This is not a bug.
In libjit we follow the C conversion standard.
So the sign extension or zero extension depends on the source type for a
widening conversion.
A signed 32bit is always sign extended to 64bit even if the target type
is unsigned.
Cheers,
Klaus
signature.asc
Description: This is a digitally signed message part