diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/math/TBigInteger.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/math/TBigInteger.java index 787bd2b82..c0121f4bb 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/math/TBigInteger.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/math/TBigInteger.java @@ -1334,7 +1334,7 @@ public class TBigInteger extends Number implements Comparable, Seri throw new ArithmeticException("BigInteger: modulus not positive"); } TBigInteger rem = remainder(m); - return ((rem.sign < 0) ? rem.add(m) : rem); + return rem.sign < 0 ? rem.add(m) : rem; } /** diff --git a/teavm-core/src/main/java/org/teavm/optimization/LoopInvariantMotion.java b/teavm-core/src/main/java/org/teavm/optimization/LoopInvariantMotion.java index ba6a79608..32b7da2c7 100644 --- a/teavm-core/src/main/java/org/teavm/optimization/LoopInvariantMotion.java +++ b/teavm-core/src/main/java/org/teavm/optimization/LoopInvariantMotion.java @@ -340,7 +340,8 @@ public class LoopInvariantMotion implements MethodOptimization { @Override public void visit(ArrayLengthInstruction insn) { - canMove = true; + // TODO: Sometimes we can cast NPE when array is null and its length is read only in certain cases + //canMove = true; } @Override @@ -349,7 +350,8 @@ public class LoopInvariantMotion implements MethodOptimization { @Override public void visit(UnwrapArrayInstruction insn) { - canMove = true; + // TODO: Sometimes we can cast NPE when array is null and is is unwrapped only in certain cases + //canMove = true; } @Override