[PATCH] D75057: Syndicate, test and fix base64 implementation

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 27 10:25:45 PST 2020


serge-sans-paille added a comment.

In D75057#1895550 <https://reviews.llvm.org/D75057#1895550>, @hokein wrote:

> thanks for doing this! didn't look into details yet. Could you explain what was the bug in the previous code?


Yeah, the code was using + operator instead of | to combine the results, which is a problem when shifting signed values. `(0xFF << 16)` is implicitly converted to a (signed) int, and thus results in `0xffff0000`, which is negative. Combining negative numbers with a `+` in that context is not what we want to do.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75057/new/

https://reviews.llvm.org/D75057





More information about the llvm-commits mailing list