Skip to content
Permalink
Browse files

[Courgette] Fix disassembler_elf_32_arm on_32bit tracking code

Previously, we used bitwise operations on booleans to keep track of
whether we are 32-bit aligned. This code ran afoul of Clang's new
-Wbool-operation and didn't implement the intended behavior. This
change fixes the bug uncovered by the warning and implements the
intended logic using boolean operations.

Bug: 1011810
Change-Id: I4a7275a4e8da274115fa8ae85c90448c036200ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1846481
Reviewed-by: Samuel Huang <huangs@chromium.org>
Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
Commit-Queue: Bob Haarman <inglorion@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703866}
  • Loading branch information
inglorion authored and Commit Bot committed Oct 8, 2019
1 parent 301f14e commit a37764afa5718284d3f3c4ad97be4b220c93c906
Showing with 1 addition and 1 deletion.
  1. +1 −1 courgette/disassembler_elf_32_arm.cc
@@ -524,7 +524,7 @@ CheckBool DisassemblerElf32ARM::ParseRel32RelocsFromSection(
// 0 | 0 1
// 0 | 1 0
// 1 | 1 1
on_32bit = (~(on_32bit ^ (op_size == 4))) != 0;
on_32bit = (on_32bit == (op_size == 4));
} else {
// Move 2 bytes at a time, but track 32-bit boundaries
p += 2;

0 comments on commit a37764a

Please sign in to comment.
You can’t perform that action at this time.