[PATCH] D126254: Add support for decoding base64.
    Greg Clayton via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue May 24 14:24:24 PDT 2022
    
    
  
clayborg marked 4 inline comments as done.
clayborg added inline comments.
================
Comment at: llvm/include/llvm/Support/Base64.h:85
+      const char Byte = Bytes[Idx + ByteIdx];
+      if (Byte == '=') {
+        if (ByteIdx <= 1) {
----------------
serge-sans-paille wrote:
> I wonder if the code would be simpler to read if the handling of the trailing '=' would be in a separate loop, that way we would have a first loop that does the fast and straight-forward processing of the stream, then a slightly more complex code to handle the trailing bytes?
Actually this would be a good idea to verify that the string ends with at most two '=' characters, and this would help to detect '=' characters in the middle of the string which would be a different error.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126254/new/
https://reviews.llvm.org/D126254
    
    
More information about the llvm-commits
mailing list