If NumBreakDowns is 0, BreakDown is null.
This trades a null dereference with an assert somewhere
else.
Details
Details
- Reviewers
bogner
Diff Detail
Diff Detail
Event Timeline
Comment Actions
I don’t think I understand what this is trying to accomplish. ISTM that this will now hit a null dereference on line 123 when we read BreadDown in the case that NumBreakDowns is zero, but this is to avoid hitting an assert somewhere else? If this is to make it clearer as to what’s failing, shouldn’t we assert NumBreakDowns != 0 here instead of just hoping to crash on a null dereference?
Comment Actions
No, that is what this avoids. Right now there is a null dereference on line 123. Now this function exits, so this continues until it hits
Assertion failed: (getOperandMapping(Idx).isValid() && "We must have a mapping for reg operands"), function verify, file ../lib/CodeGen/GlobalISel/RegisterBankInfo.cpp, line 572.