From 8e2018f944ed18400f468fd9380284d665535481 Mon Sep 17 00:00:00 2001 From: Jian J Wang Date: Sat, 8 Sep 2018 10:43:00 +0800 Subject: [PATCH] UefiCpuPkg/CpuDxe: fix an incorrect bit-wise operation BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1164 The left operand is 64-bit but right operand could be 32-bit. A typecast is a must because of '~' op before it. Cc: Hao A Wu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang Reviewed-by: Hao Wu --- UefiCpuPkg/CpuDxe/CpuPageTable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c b/UefiCpuPkg/CpuDxe/CpuPageTable.c index ef6e080a07..0a980b9753 100644 --- a/UefiCpuPkg/CpuDxe/CpuPageTable.c +++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c @@ -1181,7 +1181,7 @@ DebugExceptionHandler ( for (PFEntry = 0; PFEntry < mPFEntryCount[CpuIndex]; PFEntry++) { if (mLastPFEntryPointer[CpuIndex][PFEntry] != NULL) { - *mLastPFEntryPointer[CpuIndex][PFEntry] &= ~IA32_PG_P; + *mLastPFEntryPointer[CpuIndex][PFEntry] &= ~(UINT64)IA32_PG_P; } }