Replace IllegalStateException with error() in BitMaskTransformer

master
Graham 5 years ago
parent 248cad99e3
commit 8df0907118
  1. 4
      deob-ast/src/main/java/dev/openrs2/deob/ast/transform/BitMaskTransformer.kt

@ -35,7 +35,7 @@ class BitMaskTransformer : Transformer() {
mask = when (shiftOp) { mask = when (shiftOp) {
BinaryExpr.Operator.SIGNED_RIGHT_SHIFT -> mask shr shamt BinaryExpr.Operator.SIGNED_RIGHT_SHIFT -> mask shr shamt
BinaryExpr.Operator.UNSIGNED_RIGHT_SHIFT -> mask ushr shamt BinaryExpr.Operator.UNSIGNED_RIGHT_SHIFT -> mask ushr shamt
else -> throw IllegalStateException() else -> error("Invalid shiftOp")
} }
maskExpr = IntegerLiteralExpr(mask) maskExpr = IntegerLiteralExpr(mask)
@ -45,7 +45,7 @@ class BitMaskTransformer : Transformer() {
mask = when (shiftOp) { mask = when (shiftOp) {
BinaryExpr.Operator.SIGNED_RIGHT_SHIFT -> mask shr shamt BinaryExpr.Operator.SIGNED_RIGHT_SHIFT -> mask shr shamt
BinaryExpr.Operator.UNSIGNED_RIGHT_SHIFT -> mask ushr shamt BinaryExpr.Operator.UNSIGNED_RIGHT_SHIFT -> mask ushr shamt
else -> throw IllegalStateException() else -> error("Invalid shiftOp")
} }
maskExpr = createLong(mask) maskExpr = createLong(mask)

Loading…
Cancel
Save