|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 17/18] xencrsh: Suppress a C6385 false positive in __DumpBytes
ThisTime is min(Length - Index, 8), so every read in the switch stays
below Length, but code analysis loses that bound through the switch
and reports C6385. Suppress the warning around the loop, with a comment
saying why.
Signed-off-by: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
---
src/xencrsh/pdoinquiry.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/xencrsh/pdoinquiry.c b/src/xencrsh/pdoinquiry.c
index 97db301..8993046 100644
--- a/src/xencrsh/pdoinquiry.c
+++ b/src/xencrsh/pdoinquiry.c
@@ -635,6 +635,10 @@ __DumpBytes(
{
ULONG ThisTime, Index;
+ // ThisTime = min(Length - Index, 8): reads stay below Length.
+ // The analyzer loses that bound through the switch (C6385 false positive).
+#pragma warning(push)
+#pragma warning(disable: 6385)
for (Index = 0; Index < Length; ) {
ThisTime = __Min(Length - Index, 8);
switch (ThisTime) {
@@ -675,6 +679,7 @@ __DumpBytes(
}
Index += ThisTime;
}
+#pragma warning(pop)
}
static FORCEINLINE VOID
__DumpPage(
--
2.55.0.windows.5
--
Césaire Mounah | Vates Windows Guest Tools Engineer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |