Skip to content

Conversation

@llvmbot
Copy link
Member

@llvmbot llvmbot commented Nov 8, 2025

Backport 3673cc7

Requested by: @mstorsjo

… mode (llvm#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: llvm#144723
(cherry picked from commit 3673cc7)
@llvmbot
Copy link
Member Author

llvmbot commented Nov 8, 2025

@aganea What do you think about merging this PR to the release branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

3 participants