Fix some static analysis warnings
Most fixes are just addressing the use of (signed) enum-typed variables
as array indices. Casting to unsigned allows us to cheaply include the
lower bound checks in the existing upper bound checks. I would prefer
to force the underlying types of enumerations to be unsigned, but that
is a relatively new C++ feature and could have broader consequences than
I want to risk at this point.
The one other fix to asmparse.cpp just suppresses a warning that, while
technically valid, is not causing a real problem. Perhaps this will get
better if/when dotnet/coreclr#2305 is addressed.
Commit migrated from https://github.com/dotnet/coreclr/commit/
1c7e1f4e0b9d338c209a8e73a00c8e9ab42b22e3