llvm.org GIT mirror llvm / c093244
Fix broken asserts that never fire. Change assert("text") to assert(0 && "text"). The first case is a const char * to bool conversion, which always evaluates to true, never triggering the assert. The second case will always trigger the assert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185227 91177308-0d34-0410-b5e6-96231b3b80d8 Richard Trieu 7 years ago
2 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
17981798
17991799 unsigned LHSVal, RHSVal;
18001800 if (LHSPart.second.getAsInteger(10, LHSVal))
1801 assert("Unable to convert LHS to integer.");
1801 assert(0 && "Unable to convert LHS to integer.");
18021802 if (RHSPart.second.getAsInteger(10, RHSVal))
1803 assert("Unable to convert RHS to integer.");
1803 assert(0 && "Unable to convert RHS to integer.");
18041804 if (LHSVal != RHSVal)
18051805 return LHSVal < RHSVal;
18061806 }
178178 raw_ostream &O) const {
179179 // Branches can take an immediate operand. This is used by the branch
180180 // selection pass to print $+8, an eight byte displacement from the PC.
181 assert("Unknown branch operand.");
181 assert(0 && "Unknown branch operand.");
182182 }
183183
184184 void HexagonInstPrinter::printCallOperand(const MCInst *MI, unsigned OpNo,
202202 O << '#';
203203 printOperand(MI, OpNo, O);
204204 } else {
205 assert("Unknown symbol operand");
205 assert(0 && "Unknown symbol operand");
206206 printOperand(MI, OpNo, O);
207207 }
208208 O << ')';