YAMLIO: Encode ambiguous hex strings explicitly
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 9 Apr 2014 07:56:27 +0000 (07:56 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 9 Apr 2014 07:56:27 +0000 (07:56 +0000)
commit7184f49f400fea6d3f57566ba0749d6de53310cf
treef10039021864f6d61ad748d6a5a262562ae28e0b
parent144ffd6624c040217423aa46e9b5dc2dc0922326
YAMLIO: Encode ambiguous hex strings explicitly

YAMLIO would turn a BinaryRef into the string 0000000004000000.
However, the leading zero causes parsers to interpret it as being an
octal number instead of a hexadecimal one.

Instead, escape such strings as needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205839 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/YAMLTraits.cpp
test/Object/X86/objdump-cfg-invalid-opcode.yaml
unittests/Support/YAMLIOTest.cpp