From 9ccd151d0d27a729f88af9d00285afe4d147981a Mon Sep 17 00:00:00 2001 From: Jeff Hao Date: Fri, 20 Mar 2015 18:11:45 -0700 Subject: Fix verifier handling of empty switch as last instruction. Also fixes optimizing compiler's assumption that switch is non-empty and adds test case. Bug: 19827056 Change-Id: I5ac891d5062f528ef3be787b1094cba7b4c0fbd0 --- compiler/optimizing/builder.cc | 2 -- 1 file changed, 2 deletions(-) (limited to 'compiler/optimizing/builder.cc') diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index 2cac93dd8c..ec7fd62975 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -1024,8 +1024,6 @@ void HGraphBuilder::BuildSparseSwitch(const Instruction& instruction, uint32_t d HInstruction* value = LoadLocal(instruction.VRegA(), Primitive::kPrimInt); uint16_t num_entries = table.GetNumEntries(); - // There should be at least one entry here. - DCHECK_GT(num_entries, 0U); for (size_t i = 0; i < num_entries; i++) { BuildSwitchCaseHelper(instruction, i, i == static_cast(num_entries) - 1, table, value, -- cgit v1.2.3-59-g8ed1b