[lld] r277222 - [LinkerScript] Filler can have a decimal value.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 2 15:03:02 PDT 2016
On Tue, Aug 2, 2016 at 5:59 AM, Rafael EspĂndola
<rafael.espindola at gmail.com> wrote:
>> + next();
>> + if (Tok.startswith("=0x"))
>> + return parseHex(Tok.substr(3));
>
> This is missing the error check for Value below.
>
My understanding is that we support arbitrary hex values, the
restriction is only for decimal.
>> + // This must be a decimal.
>> + unsigned int Value;
>> + if (Tok.substr(1).getAsInteger(10, Value)) {
>> + setError("filler should be a decimal/hexadecimal value");
>> return {};
>> }
>> - Tok = Tok.substr(3);
>> - next();
>> - return parseHex(Tok);
>> + if (Value > 255)
>> + setError("only single bytes decimal are supported for the filler now");
>
> I think you can just pass a base of 0 to getAsInteger and it will
> detect the base.
>
I'm fine with this, but at this point we can also accept octals, and
I'm not sure we want to do that. Does this make sense?
> Cheers,
> Rafael
--
Davide
"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare
More information about the llvm-commits
mailing list