From 4232f4e605bf709042f9b295eb9169097d1d8a45 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Tue, 1 Jul 2014 14:46:44 +0000 Subject: [PATCH] Rephrase loop so it doesn't leave unused bools around in Release mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212102 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-readobj/ARMWinEHPrinter.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/llvm-readobj/ARMWinEHPrinter.cpp b/tools/llvm-readobj/ARMWinEHPrinter.cpp index f6675bdcfed..b486e4ad0e5 100644 --- a/tools/llvm-readobj/ARMWinEHPrinter.cpp +++ b/tools/llvm-readobj/ARMWinEHPrinter.cpp @@ -508,15 +508,13 @@ void Decoder::decodeOpcodes(ArrayRef Opcodes, unsigned Offset, bool Terminated = false; for (unsigned OI = Offset, OE = Opcodes.size(); !Terminated && OI < OE; ) { - bool Decoded = false; - for (unsigned DI = 0, DE = array_lengthof(Ring); DI < DE; ++DI) { + for (unsigned DI = 0;; ++DI) { if ((Opcodes[OI] & Ring[DI].Mask) == Ring[DI].Value) { Terminated = (this->*Ring[DI].Routine)(Opcodes.data(), OI, 0, Prologue); - Decoded = true; break; } + assert(DI < array_lengthof(Ring) && "unhandled opcode"); } - assert(Decoded && "unhandled opcode"); } }