[PATCH] D25516: [Object/ELF] - Check index argument in getSymbol().

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 05:53:25 PDT 2016

On 27 October 2016 at 18:07, Rui Ueyama <ruiu at google.com> wrote:
> On second thought, we should never use report_fatal_error in libObject to
> report corrupted input, because it enforces a specific error handling policy
> rather than defer it to an application. Could you return an error instead?

I like it as an intermediary step.

It avoids undefined behaviour, which is an improvement.
It is obvious what it does and it let us add a test. With the test
passing we can change the code to return an error.


More information about the llvm-commits mailing list