Typo in ARM opnd_compute_address_priv caught by GCC 7.3.0
Created by: egrimley
With the GCC in Debian unstable I got this warning:
/.../dynamorio/core/arch/opnd_shared.c:1920:72: error: ?: using integer constants in boolean context [-Werror=int-in-bool-context]
(TEST(EFLAGS_C, mc->cpsr) ? (1 << (sizeof(reg_t)*8-1)) : 0);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
GCC deserves a pat on the head for this, because it seems to have caught a real bug: the ||
at the end of line 1919 should be a |
, I think. What the code seems to be doing is computing the effective address when RRX is used in an address calculation: a very weird thing to do, so it's not surprising if it was never tested. (Is there a place where a test for this could easily be added? Not worth adding a new top-level test just for this.)