summaryrefslogtreecommitdiff
path: root/src/vm/methodtable.h
diff options
context:
space:
mode:
authorRuss Keldorph <diff.tool>2017-04-30 06:17:30 -0700
committerRuss Keldorph <russ.keldorph@microsoft.com>2017-05-03 14:20:19 -0700
commit1c7e1f4e0b9d338c209a8e73a00c8e9ab42b22e3 (patch)
tree617f57dadfcc76346d6ff177cb7085dacfbaed3e /src/vm/methodtable.h
parente85c2b298e89147d71605c36d9109f87be2b3079 (diff)
downloadcoreclr-1c7e1f4e0b9d338c209a8e73a00c8e9ab42b22e3.tar.gz
coreclr-1c7e1f4e0b9d338c209a8e73a00c8e9ab42b22e3.tar.bz2
coreclr-1c7e1f4e0b9d338c209a8e73a00c8e9ab42b22e3.zip
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 #2305 is addressed.
Diffstat (limited to 'src/vm/methodtable.h')
-rw-r--r--src/vm/methodtable.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vm/methodtable.h b/src/vm/methodtable.h
index df60fca09d..1e557c4253 100644
--- a/src/vm/methodtable.h
+++ b/src/vm/methodtable.h
@@ -663,7 +663,7 @@ SystemVClassificationType CorInfoType2UnixAmd64Classification(CorElementType eeT
_ASSERTE((SystemVClassificationType)toSystemVAmd64ClassificationTypeMap[ELEMENT_TYPE_TYPEDBYREF] == SystemVClassificationTypeTypedReference);
_ASSERTE((SystemVClassificationType)toSystemVAmd64ClassificationTypeMap[ELEMENT_TYPE_BYREF] == SystemVClassificationTypeIntegerByRef);
- return (((int)eeType) < ELEMENT_TYPE_MAX) ? (toSystemVAmd64ClassificationTypeMap[eeType]) : SystemVClassificationTypeUnknown;
+ return (((unsigned)eeType) < ELEMENT_TYPE_MAX) ? (toSystemVAmd64ClassificationTypeMap[eeType]) : SystemVClassificationTypeUnknown;
};
#define SYSTEMV_EIGHT_BYTE_SIZE_IN_BYTES 8 // Size of an eightbyte in bytes.