From 0908b2c68d36b805b9d1e30cb7d0d84fa176f979 Mon Sep 17 00:00:00 2001 From: mikelle-rogers Date: Wed, 3 Jul 2024 08:57:37 -0700 Subject: [PATCH] CodeQL spillStack --- src/coreclr/utilcode/ilformatter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coreclr/utilcode/ilformatter.cpp b/src/coreclr/utilcode/ilformatter.cpp index baf4f5b56c97e..086183250673b 100644 --- a/src/coreclr/utilcode/ilformatter.cpp +++ b/src/coreclr/utilcode/ilformatter.cpp @@ -133,12 +133,12 @@ void ILFormatter::setTarget(size_t ilOffset, size_t depth) { /***************************************************************************/ void ILFormatter::spillStack(OutString* out) { - for(unsigned i = 0; i < stackDepth(); i++) { + for(size_t i = 0; i < stackDepth(); i++) { // don't bother spilling something already spilled. if (memcmp(stackStart[i].val.val(), "@STK", 4) != 0) - *out << "@STK" << i << " = " << stackStart[i].val.val() << "\n"; + *out << "@STK" << static_cast(i) << " = " << stackStart[i].val.val() << "\n"; stackStart[i].val.clear(); - stackStart[i].val << "@STK" << i ; + stackStart[i].val << "@STK" << static_cast(i); } }