ART: Fix divide-by-zero for ARM

There was an infinite loop in the code generation for a divide
by literal zero.

Bug: 18887754

(cherry picked from commit cfe71e59c667abb35bc2363c49af7f8b549c44d0)

Change-Id: Ibd481918d3c6d7bc62fdd1a6807042009f561d95
diff --git a/compiler/dex/quick/arm/int_arm.cc b/compiler/dex/quick/arm/int_arm.cc
index 541f6c8..b299d9b 100644
--- a/compiler/dex/quick/arm/int_arm.cc
+++ b/compiler/dex/quick/arm/int_arm.cc
@@ -550,6 +550,14 @@
 
 // Try to convert *lit to 1 RegRegRegShift/RegRegShift form.
 bool ArmMir2Lir::GetEasyMultiplyOp(int lit, ArmMir2Lir::EasyMultiplyOp* op) {
+  if (lit == 0) {
+    // Special case for *divide-by-zero*. The ops won't actually be used to generate code, as
+    // GenArithOpIntLit will directly generate exception-throwing code, and multiply-by-zero will
+    // have been optimized away earlier.
+    op->op = kOpInvalid;
+    return true;
+  }
+
   if (IsPowerOfTwo(lit)) {
     op->op = kOpLsl;
     op->shift = LowestSetBit(lit);