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

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 15:29:33 PDT 2024


adrian-prantl 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.

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


More information about the llvm-commits mailing list