llvm-project
3673cc7a - [llvm-rc] Don't interpret integer literals as octal numbers in rc.exe mode (#166915)

Commit
50 days ago
[llvm-rc] Don't interpret integer literals as octal numbers in rc.exe mode (#166915) It turns out that rc.exe doesn't interpret integer literals as octal numbers - but GNU windres does. Previously, llvm-rc did interpret them as octal. Fix the issue by stripping away the leading zeros during tokenization. The alternative (which would be somewhat cleaner, as visible in tokenizer.test) would be to retain them in the RCToken object, but strip them out before calling StringRef::getAsInteger. Alternatively to handle the radix detection locally in llvm-rc code and not rely on getAsInteger to autodetect it. Both of those solutions require propagating the IsWindres flag so that it is available within RCToken, or at least when calling RCToken::intValue(). Fixes: https://github.com/llvm/llvm-project/issues/144723
Author
Parents
Loading