diff options
author | Zachary Turner <zturner@google.com> | 2014-11-10 22:31:51 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2014-11-10 22:31:51 +0000 |
commit | ba80da60c806bc2d7ae65bc557b519ebb2772901 (patch) | |
tree | 4ac9e965d50a1b46764925f26c892bad5afd1d55 | |
parent | 4c1a96f5192b0aa5a29ae0e2be88dad166cd8f3a (diff) | |
download | bcm5719-llvm-ba80da60c806bc2d7ae65bc557b519ebb2772901.tar.gz bcm5719-llvm-ba80da60c806bc2d7ae65bc557b519ebb2772901.zip |
Fix some compiler warnings, one of which was a legit bug.
MSVC warns that not all control paths return a value when a switch
doesn't have a default case handler. Changed explicit value checks
to a default check.
Also, it caught a case where bitwise AND was being used instead of
logical AND. I'm not sure what this fixes, but presumably it is
not covered by any kind of test case.
llvm-svn: 221636
-rw-r--r-- | lldb/include/lldb/Interpreter/CommandInterpreter.h | 8 | ||||
-rw-r--r-- | lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp | 4 |
2 files changed, 5 insertions, 7 deletions
diff --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h b/lldb/include/lldb/Interpreter/CommandInterpreter.h index ddc4dbab4c1..81193fcd3ad 100644 --- a/lldb/include/lldb/Interpreter/CommandInterpreter.h +++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h @@ -173,11 +173,10 @@ public: { switch (flag) { - case eLazyBoolCalculate: - case eLazyBoolYes: - return true; case eLazyBoolNo: return false; + default: + return true; } } @@ -188,8 +187,7 @@ public: { case eLazyBoolYes: return true; - case eLazyBoolCalculate: - case eLazyBoolNo: + default: return false; } } diff --git a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp index d6f8f2457f0..da46fa181aa 100644 --- a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp +++ b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp @@ -840,8 +840,8 @@ loopnext: { ret_insn_offset = m_func_bounds.GetByteSize() - 6; } - else if (bytebuf[0] == 0x5d && bytebuf[1] == 0xc3 - && bytebuf[2] == 0x0f && bytebuf[3] == 0x1f & bytebuf[4] == 0x44) // mov & ret & nop + else if (bytebuf[0] == 0x5d && bytebuf[1] == 0xc3 + && bytebuf[2] == 0x0f && bytebuf[3] == 0x1f && bytebuf[4] == 0x44) // mov & ret & nop { ret_insn_offset = m_func_bounds.GetByteSize() - 6; } |