Re: [PATCH v16 00/10] Add support for LoongArch

2023-05-17 Thread Daniel Kiper
On Fri, Apr 28, 2023 at 04:39:24PM +0200, Daniel Kiper wrote: > On Thu, Apr 27, 2023 at 03:42:59PM +0800, Xiaotian Wu wrote: > > LoongArch is a new Loongson 3A5000 CPU instruction set, you can read > > documents [1] or visit the development community [2] to get more > > information. > > > > [1]: h

[PATCH] loongarch: Avoid undefined behavior when popping from an empty reloc stack

2023-05-17 Thread WANG Xuerui
The return value of grub_loongarch64_stack_pop is unsigned, so -1 should not be used in the first place. Replacing with 0 is enough to avoid the UB in this edge case. Technically though, proper error handling is needed throughout the management of the reloc stack, so no unexpected behavior will ha

Re: [PATCH] loongarch: Avoid undefined behavior when popping from an empty reloc stack

2023-05-17 Thread Xiaotian Wu
LGTM, thank you. 在 2023-05-18星期四的 10:52 +0800,WANG Xuerui写道: > The return value of grub_loongarch64_stack_pop is unsigned, so -1 > should > not be used in the first place. Replacing with 0 is enough to avoid > the > UB in this edge case. > > Technically though, proper error handling is needed thr