[PATCH] D127902: [Object][COFF] Improve section name parsing

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 14:28:39 PDT 2022


rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm



================
Comment at: llvm/lib/Object/COFFObjectFile.cpp:1159
     } else {
       if (Name.substr(1).consumeInteger(10, Offset))
         return createStringError(object_error::parse_failed,
----------------
pzheng wrote:
> rnk wrote:
> > This can now be getAsInteger, right?
> Compared to getAsInteger, consumeInteger is a little more error tolerant and can handle inputs like "/4abcdef". However, I haven't actually seen any input like that in the wild yet, so it's probably fine if we use getAsInteger. Thoughts?
I think it would be reasonable to report an error for such a section name, so I support that change, but either way, the `split` code is simpler than what we currently have.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127902



More information about the llvm-commits mailing list