Verify the possibility of accidental passing of an invalid MCFixupKind value which can cause an invalid access in the array, and guard from it via assert.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
60,030 ms | x64 debian > MLIR.Examples/standalone::test.toy |
Event Timeline
llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp | ||
---|---|---|
188 | Isn’t this equivalent to the previous bounds check? |
llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp | ||
---|---|---|
188 | Thank you for checking this @arsenm ! I don't think it is or at least see it as exactly the same check. Kind < 128 (FirstTargetFixupKind) -> returns FK_NONE which I think it's no-op here Yes, obviously only the AMDGPU::fixup_si_sopp_br fixup kind which is valid will be used for AMDGPU but the assert is here as a security guard to the Infos array in case of misuse. I can agree to the point this can do and is safe without the assert, but from the outside it looks like a security concern, which we will only know it will not occur after we dig into the logic. |
Isn’t this equivalent to the previous bounds check?