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

Pengxuan Zheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 14:51:57 PDT 2022


pzheng added inline comments.


================
Comment at: llvm/lib/Object/COFFObjectFile.cpp:1159
     } else {
       if (Name.substr(1).consumeInteger(10, Offset))
         return createStringError(object_error::parse_failed,
----------------
rnk wrote:
> 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.
Agreed, will change to getAsInteger.


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