summaryrefslogtreecommitdiff
path: root/MdePkg/Library/UefiMemoryLib
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/UefiMemoryLib')
-rw-r--r--MdePkg/Library/UefiMemoryLib/SetMem16Wrapper.c6
-rw-r--r--MdePkg/Library/UefiMemoryLib/SetMem32Wrapper.c6
-rw-r--r--MdePkg/Library/UefiMemoryLib/SetMem64Wrapper.c6
3 files changed, 9 insertions, 9 deletions
diff --git a/MdePkg/Library/UefiMemoryLib/SetMem16Wrapper.c b/MdePkg/Library/UefiMemoryLib/SetMem16Wrapper.c
index 3acbdac436..dea31608fe 100644
--- a/MdePkg/Library/UefiMemoryLib/SetMem16Wrapper.c
+++ b/MdePkg/Library/UefiMemoryLib/SetMem16Wrapper.c
@@ -52,10 +52,10 @@ SetMem16 (
IN UINT16 Value
)
{
- ASSERT (Buffer != NULL);
+ ASSERT (!(Buffer == NULL && Length > 0));
ASSERT (Length <= MAX_ADDRESS - (UINTN)Buffer + 1);
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) != 0);
- ASSERT ((Length & (sizeof (Value) - 1)) != 0);
+ ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
+ ASSERT ((Length & (sizeof (Value) - 1)) == 0);
if ((Length /= sizeof (Value)) == 0) {
return Buffer;
diff --git a/MdePkg/Library/UefiMemoryLib/SetMem32Wrapper.c b/MdePkg/Library/UefiMemoryLib/SetMem32Wrapper.c
index 620b69aef4..1ae7acb013 100644
--- a/MdePkg/Library/UefiMemoryLib/SetMem32Wrapper.c
+++ b/MdePkg/Library/UefiMemoryLib/SetMem32Wrapper.c
@@ -52,10 +52,10 @@ SetMem32 (
IN UINT32 Value
)
{
- ASSERT (Buffer != NULL);
+ ASSERT (!(Buffer == NULL && Length > 0));
ASSERT (Length <= MAX_ADDRESS - (UINTN)Buffer + 1);
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) != 0);
- ASSERT ((Length & (sizeof (Value) - 1)) != 0);
+ ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
+ ASSERT ((Length & (sizeof (Value) - 1)) == 0);
if ((Length /= sizeof (Value)) == 0) {
return Buffer;
diff --git a/MdePkg/Library/UefiMemoryLib/SetMem64Wrapper.c b/MdePkg/Library/UefiMemoryLib/SetMem64Wrapper.c
index 73c28af4a1..0128a2d6f1 100644
--- a/MdePkg/Library/UefiMemoryLib/SetMem64Wrapper.c
+++ b/MdePkg/Library/UefiMemoryLib/SetMem64Wrapper.c
@@ -52,10 +52,10 @@ SetMem64 (
IN UINT64 Value
)
{
- ASSERT (Buffer != NULL);
+ ASSERT (!(Buffer == NULL && Length > 0));
ASSERT (Length <= MAX_ADDRESS - (UINTN)Buffer + 1);
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) != 0);
- ASSERT ((Length & (sizeof (Value) - 1)) != 0);
+ ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
+ ASSERT ((Length & (sizeof (Value) - 1)) == 0);
if ((Length /= sizeof (Value)) == 0) {
return Buffer;