DynamicTablesPkg: AmlLib: Fix CodeQL Issue

Without the addition of this cast, the compiler promotes 1 to
a UINT32, which leads CodeQL to complain that different
size types are being compared.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
This commit is contained in:
Oliver Smith-Denny 2024-01-31 13:52:26 -08:00 committed by mergify[bot]
parent 80d9b44491
commit 596773f5e3

View File

@ -774,7 +774,7 @@ AmlSetPkgLength (
// Write to the Buffer.
*Buffer = LeadByte;
CurrentOffset = 1;
while (CurrentOffset < (Offset + 1)) {
while (CurrentOffset < (Offset + (UINT8)1)) {
CurrentShift = (UINT8)((CurrentOffset - 1) * 8);
ComputedLength = Length & (UINT32)(0x00000FF0 << CurrentShift);
ComputedLength = (ComputedLength) >> (4 + CurrentShift);