[llvm] [Support] Add decodeULEB128AndInc/decodeSLEB128AndInc (PR #85739)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 21:26:31 PDT 2024


dwblaikie wrote:

> > (this API feels close to gets (which, admittedly, is maximally unsafe - you can't control its input - but that's /usually/ the case with most of these uleb readings - except these sort of special cases where the input is built into the code/file, like tblgen))
> 
> This API will read at most 9 bytes out of bounds, but evidently any byte out of bounds is one too many. When I reviewed the original patch I was under the assumption that users of this API would check for the bounds in their outer parse loop, but maybe we're not saving a ton of performance by omitting the bounds check here.

Will it? If the ULEB is non-canonical, I thought it could read arbitrarily out of bounds? How's the 9 byte limit manifest?

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


More information about the llvm-commits mailing list