]> granicus.if.org Git - yasm/commitdiff
Fix handling of >32 bit NASM character constants; they were being shifted
authorPeter Johnson <peter@tortall.net>
Tue, 2 Mar 2004 05:53:30 +0000 (05:53 -0000)
committerPeter Johnson <peter@tortall.net>
Tue, 2 Mar 2004 05:53:30 +0000 (05:53 -0000)
an extra time.

Bugzilla bug: 25
Reported by: vclaudepierre@tiscali.fr

svn path=/trunk/yasm/; revision=1100

libyasm/intnum.c
libyasm/tests/Makefile.inc
libyasm/tests/charconst64.asm [new file with mode: 0644]
libyasm/tests/charconst64.errwarn [new file with mode: 0644]
libyasm/tests/charconst64.hex [new file with mode: 0644]

index b0b8217790b7f9b089292bfc7b0ac46420a44f06..d3895aefb3b2116bf8065fc1aea8b9ff04e15191 100644 (file)
@@ -214,9 +214,9 @@ yasm_intnum_create_charconst_nasm(const char *str, unsigned long line)
        default:
            /* >32 bit conversion */
            while (len) {
+               BitVector_Move_Left(conv_bv, 8);
                BitVector_Chunk_Store(conv_bv, 8, 0,
                                      (unsigned long)str[--len]);
-               BitVector_Move_Left(conv_bv, 8);
            }
            intn->val.bv = BitVector_Clone(conv_bv);
     }
index c38aca97128cc48dd20a5d45a5aa454baadad4df..11266b03279f3ddf84c6d37bb713dbbcbc9162da 100644 (file)
@@ -5,6 +5,9 @@ TESTS += floatnum_test
 TESTS += libyasm/tests/libyasm_test.sh
 
 EXTRA_DIST += libyasm/tests/libyasm_test.sh
+EXTRA_DIST += libyasm/tests/charconst64.asm
+EXTRA_DIST += libyasm/tests/charconst64.errwarn
+EXTRA_DIST += libyasm/tests/charconst64.hex
 EXTRA_DIST += libyasm/tests/duplabel-err.asm
 EXTRA_DIST += libyasm/tests/duplabel-err.errwarn
 EXTRA_DIST += libyasm/tests/unary.asm
diff --git a/libyasm/tests/charconst64.asm b/libyasm/tests/charconst64.asm
new file mode 100644 (file)
index 0000000..57856c0
--- /dev/null
@@ -0,0 +1,3 @@
+[bits 64]
+
+mov rax, '12345678'
diff --git a/libyasm/tests/charconst64.errwarn b/libyasm/tests/charconst64.errwarn
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/libyasm/tests/charconst64.hex b/libyasm/tests/charconst64.hex
new file mode 100644 (file)
index 0000000..66b893c
--- /dev/null
@@ -0,0 +1,10 @@
+48 
+b8 
+31 
+32 
+33 
+34 
+35 
+36 
+37 
+38