[PATCH] D55694: GlobalISel: Improve crash on invalid mapping
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 14 00:24:28 PST 2018
arsenm created this revision.
Herald added subscribers: kristof.beyls, rovka, wdng.
If NumBreakDowns is 0, BreakDown is null.
This trades a null dereference with an assert somewhere
else.
https://reviews.llvm.org/D55694
Files:
lib/CodeGen/GlobalISel/RegBankSelect.cpp
Index: lib/CodeGen/GlobalISel/RegBankSelect.cpp
===================================================================
--- lib/CodeGen/GlobalISel/RegBankSelect.cpp
+++ lib/CodeGen/GlobalISel/RegBankSelect.cpp
@@ -116,7 +116,7 @@
OnlyAssign = false;
// Each part of a break down needs to end up in a different register.
// In other word, Reg assignement does not match.
- if (ValMapping.NumBreakDowns > 1)
+ if (ValMapping.NumBreakDowns != 1)
return false;
const RegisterBank *CurRegBank = RBI->getRegBank(Reg, *MRI, *TRI);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55694.178195.patch
Type: text/x-patch
Size: 541 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181214/be274c4a/attachment.bin>
More information about the llvm-commits
mailing list