diff options
author | Peter Johnson <peter@tortall.net> | 2010-01-01 20:47:58 +0000 |
---|---|---|
committer | Peter Johnson <peter@tortall.net> | 2010-01-01 20:47:58 +0000 |
commit | b70e2373f75585edca75a1a3736cc049b9a9bdbb (patch) | |
tree | c98d704b062f3eaeb0962b62ebf50cd5d4ee844f /libyasm | |
parent | 65b18427f41294fef3193c4a5ed794d3a17c1e2a (diff) | |
download | yasm-b70e2373f75585edca75a1a3736cc049b9a9bdbb.tar.gz |
yasm_intnum_create_sized(): Fix off-by-one error in sign extension check.
svn path=/trunk/yasm/; revision=2253
Diffstat (limited to 'libyasm')
-rw-r--r-- | libyasm/intnum.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libyasm/intnum.c b/libyasm/intnum.c index e39eb26f..625349c6 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -385,7 +385,7 @@ yasm_intnum_create_sized(unsigned char *ptr, int sign, size_t srcsize, } /* Sign extend if needed */ - if (srcsize*8 < BITVECT_NATIVE_SIZE && sign && (ptr[i] & 0x80) == 0x80) + if (srcsize*8 < BITVECT_NATIVE_SIZE && sign && (ptr[i-1] & 0x80) == 0x80) BitVector_Interval_Fill(conv_bv, i*8, BITVECT_NATIVE_SIZE-1); intnum_frombv(intn, conv_bv); |