diff options
-rw-r--r-- | libdexfile/dex/dex_instruction.cc | 7 | ||||
-rw-r--r-- | libdexfile/dex/dex_instruction.h | 4 |
2 files changed, 3 insertions, 8 deletions
diff --git a/libdexfile/dex/dex_instruction.cc b/libdexfile/dex/dex_instruction.cc index 27feb08d77..4887491509 100644 --- a/libdexfile/dex/dex_instruction.cc +++ b/libdexfile/dex/dex_instruction.cc @@ -55,13 +55,6 @@ int32_t Instruction::GetTargetOffset() const { } } -bool Instruction::CanFlowThrough() const { - const uint16_t* insns = reinterpret_cast<const uint16_t*>(this); - uint16_t insn = *insns; - Code opcode = static_cast<Code>(insn & 0xFF); - return FlagsOf(opcode) & Instruction::kContinue; -} - size_t Instruction::SizeInCodeUnitsComplexOpcode() const { // Handle special NOP encoded variable length sequences. uint16_t inst_data = Fetch16(0); diff --git a/libdexfile/dex/dex_instruction.h b/libdexfile/dex/dex_instruction.h index cf676681e0..07f035c108 100644 --- a/libdexfile/dex/dex_instruction.h +++ b/libdexfile/dex/dex_instruction.h @@ -552,7 +552,9 @@ class Instruction { int32_t GetTargetOffset() const; // Returns true if the instruction allows control flow to go to the following instruction. - bool CanFlowThrough() const; + bool CanFlowThrough() const { + return (FlagsOf(Opcode()) & Instruction::kContinue) != 0; + } // Returns true if this instruction is a switch. bool IsSwitch() const { |