Fix build warning/error about converting a constant to a boolean (#42389)
authorOmair Majid <omajid@redhat.com>
Fri, 18 Sep 2020 03:22:06 +0000 (23:22 -0400)
committerGitHub <noreply@github.com>
Fri, 18 Sep 2020 03:22:06 +0000 (20:22 -0700)
commitbbacfec484725aa8711d5e960c798ce12b929060
treeb2e4945a16abf56e30ea2788f6268b3bb584d573
parent527f9ae88a0ee216b44d556f9bdc84037fe0ebda
Fix build warning/error about converting a constant to a boolean (#42389)

On Fedora 32 with Clang 10, I get this warning/error when building
coreclr:

    /home/omajid/devel/dotnet/runtime/src/coreclr/src/jit/emitarm.cpp:5553:31: error: converting the enum constant to a boolean [-Werror,-Wint-in-bool-context]
            assert(ins == INS_cbz || INS_cbnz);
                                  ^

This looks like a bug that should be fixed: ins should be compared with
the constant on both sides of the boolean operator. Otherwise the
conditional can always evaluate to true.
src/coreclr/src/jit/emitarm.cpp