OSDN Git Service

elf_builder: Fix Mips header flags
authorGreg Kaiser <gkaiser@google.com>
Thu, 16 Jun 2016 22:55:15 +0000 (15:55 -0700)
committerGreg Kaiser <gkaiser@google.com>
Thu, 16 Jun 2016 22:55:15 +0000 (15:55 -0700)
Bitwise OR has a higher precendence than ternary conditional,
so we need to use parentheses around our ternary conditional
to get the behavior we desire.

Bug: 28320822
Change-Id: I4b95ab88e688176939f16f8586d45784c9d92a42

compiler/elf_builder.h

index 26ab281..7f2e193 100644 (file)
@@ -780,9 +780,9 @@ class ElfBuilder FINAL {
                               EF_MIPS_PIC       |
                               EF_MIPS_CPIC      |
                               EF_MIPS_ABI_O32   |
-                              features->AsMipsInstructionSetFeatures()->IsR6()
-                                  ? EF_MIPS_ARCH_32R6
-                                  : EF_MIPS_ARCH_32R2);
+                              (features->AsMipsInstructionSetFeatures()->IsR6()
+                                   ? EF_MIPS_ARCH_32R6
+                                   : EF_MIPS_ARCH_32R2));
         break;
       }
       case kMips64: {