[llvm] r205839 - YAMLIO: Encode ambiguous hex strings explicitly

Sean Silva chisophugis at gmail.com
Wed Apr 9 10:51:34 PDT 2014


On Wed, Apr 9, 2014 at 10:50 AM, Michael Spencer <bigcheesegs at gmail.com>wrote:

> On Wed, Apr 9, 2014 at 8:56 AM, David Majnemer <david.majnemer at gmail.com>
> wrote:
> > Author: majnemer
> > Date: Wed Apr  9 02:56:27 2014
> > New Revision: 205839
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=205839&view=rev
> > Log:
> > 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.
> >
>
> This is wrong. In YAML all numbers are treated as decimal. Also this
> changes the tag type of the value to !!str.
>

FWIW I expect BinaryRef output to be !!str; I would consider it a bug if
that wasn't the case.

-- Sean Silva


>
> The correct change is to fix the reader to always do decimal and
> handle the 0x and 0o prefixes.
>
> See: http://www.yaml.org/spec/1.2/spec.html#id2805071
>
> - Michael Spencer
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140409/d00d30a5/attachment.html>


More information about the llvm-commits mailing list