[llvm] [Support] Add end/error to decode[US]LEB128AndInc (PR #90006)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 21:08:12 PDT 2024


dwblaikie wrote:

This is certainly the minimum I'd like to see (as problematic as the API it's wrapping, rather than worse - so it doesn't cause people to be even less inclined to do error checking due to the convenience of a wrapper that lacks the underlying error handling).

Though I certainly wouldn't mind more robust error checking/improving code when call sites are revisited/updated to use the newer API (without necessarily the motivation to cleanup all uses of the older more relaxed API)

I'm not sure what cases/where one wouldn't have a good end parameter? Lack of one seems like a problem (except in something narrow like the tablegen case, where the buffer being read is baked into the program and known-good - at least in that case the end isn't hard to know/find, if technically unnecessary, but I still wouldn't mind if that got some bounds checking too, I can't imagine that it'd substantially harm performance, though I could be wrong)

https://github.com/llvm/llvm-project/pull/90006


More information about the llvm-commits mailing list