[PATCH] D118005: [hmaptool] Fix string decoding for Python 3

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 23 12:54:38 PST 2022


smeenai created this revision.
smeenai added a reviewer: bruno.
smeenai requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Our "strings" were actually bytes, which made verbose dumping fail.
Decode them so they actually become strings.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118005

Files:
  clang/utils/hmaptool/hmaptool


Index: clang/utils/hmaptool/hmaptool
===================================================================
--- clang/utils/hmaptool/hmaptool
+++ clang/utils/hmaptool/hmaptool
@@ -100,7 +100,7 @@
             raise SystemExit("error: %s: invalid string index" % (
                     idx,))
         end_idx = self.strtable.index(0, idx)
-        return self.strtable[idx:end_idx]
+        return self.strtable[idx:end_idx].decode()
 
     @property
     def mappings(self):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118005.402367.patch
Type: text/x-patch
Size: 473 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220123/7cde21d3/attachment.bin>


More information about the cfe-commits mailing list