[llvm] [AVR] Fix a crash in AVRInstrInfo::insertIndirectBranch (PR #67324)

Ben Shi via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 18:36:52 PDT 2023


benshi001 wrote:

> > With the attached b.s, an linker error is reported as
> 
> And what about the LLVM linker (lld)? Does it report a similar error? (I would assume so, because LLD normally generates such "out of space" errors).
> 
> > but it is not easy to add such a test into my patch.
> 
> No I don't think it should be part of the test, just something to verify before committing. If we add a test it would be a separate test to LLD that checks whether an error is generated as we would expect.
> 
> In any case, I think this patch is ready to go from my POV, but perhaps others will like to take a look as well.

LLD checks range for conditional branch: https://github.com/llvm/llvm-project/blob/main/lld/ELF/Arch/AVR.cpp#L233, 

but does not for RJMP: https://github.com/llvm/llvm-project/blob/main/lld/ELF/Arch/AVR.cpp#L240C8-L240C22

I will fix that in another patch.

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


More information about the llvm-commits mailing list