Increase test coverage (#1661)

This commit is contained in:
Rangi
2025-02-16 15:29:16 +01:00
committed by GitHub
parent 993879a2ed
commit c9060c7f2d
5 changed files with 12 additions and 20 deletions

View File

@@ -358,7 +358,8 @@ void Expression::makeUnaryOp(RPNCommand op, Expression &&src) {
case RPN_BIT_INDEX:
case RPN_CONST:
case RPN_SYM:
fatalerror("%d is not an unary operator\n", op);
// `makeUnaryOp` should never be called with a non-unary operator!
unreachable_();
}
} else if (op == RPN_LOGNOT && tryConstLogNot(src)) {
data = 0;
@@ -522,7 +523,8 @@ void Expression::makeBinaryOp(RPNCommand op, Expression &&src1, Expression const
case RPN_TZCOUNT:
case RPN_CONST:
case RPN_SYM:
fatalerror("%d is not a binary operator\n", op);
// `makeBinaryOp` should never be called with a non-binary operator!
unreachable_();
}
} else if (op == RPN_SUB && src1.isDiffConstant(src2.symbolOf())) {
data = src1.symbolOf()->getValue() - src2.symbolOf()->getValue();