diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-09-16 04:51:25 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-09-16 04:51:25 +0000 |
commit | cd7bfc2c632841fab110f601a32850eeddc16af1 (patch) | |
tree | 4d1f82523dd545fa241053cf52b31b8c2b915fe7 /MdeModulePkg/Core | |
parent | 7bee5a761f4cbafd1e1805dfd99255a0353bbf88 (diff) | |
download | edk2-platforms-cd7bfc2c632841fab110f601a32850eeddc16af1.tar.xz |
Refine code to make code run safely.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10880 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core')
-rw-r--r-- | MdeModulePkg/Core/Dxe/Event/Tpl.c | 2 | ||||
-rw-r--r-- | MdeModulePkg/Core/Dxe/Hand/Locate.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/MdeModulePkg/Core/Dxe/Event/Tpl.c b/MdeModulePkg/Core/Dxe/Event/Tpl.c index 7fe9b12600..240e8e453d 100644 --- a/MdeModulePkg/Core/Dxe/Event/Tpl.c +++ b/MdeModulePkg/Core/Dxe/Event/Tpl.c @@ -118,7 +118,7 @@ CoreRestoreTpl ( // Dispatch any pending events
//
while (((-2 << NewTpl) & gEventPending) != 0) {
- gEfiCurrentTpl = HighBitSet64 (gEventPending);
+ gEfiCurrentTpl = (UINTN) HighBitSet64 (gEventPending);
if (gEfiCurrentTpl < TPL_HIGH_LEVEL) {
CoreSetInterruptState (TRUE);
}
diff --git a/MdeModulePkg/Core/Dxe/Hand/Locate.c b/MdeModulePkg/Core/Dxe/Hand/Locate.c index 9714f64d95..df7fa8fa6d 100644 --- a/MdeModulePkg/Core/Dxe/Hand/Locate.c +++ b/MdeModulePkg/Core/Dxe/Hand/Locate.c @@ -490,7 +490,8 @@ CoreLocateDevicePath ( // Check if DevicePath is first part of SourcePath
//
Size = GetDevicePathSize (TmpDevicePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL);
- if ((Size <= SourceSize) && CompareMem (SourcePath, TmpDevicePath, Size) == 0) {
+ ASSERT (Size >= 0);
+ if ((Size <= SourceSize) && CompareMem (SourcePath, TmpDevicePath, (UINTN) Size) == 0) {
//
// If the size is equal to the best match, then we
// have a duplicate device path for 2 different device
|