@@ -47,6 +47,9 @@ CopyGuid (
IN CONST GUID *SourceGuid
)
{
+ ASSERT (DestinationGuid != NULL);
+ ASSERT (SourceGuid != NULL);
+
WriteUnaligned64 (
(UINT64*)DestinationGuid,
ReadUnaligned64 ((CONST UINT64*)SourceGuid)
@@ -86,6 +89,9 @@ CompareGuid (
UINT64 HighPartOfGuid1;
UINT64 HighPartOfGuid2;
+ ASSERT (Guid1 != NULL);
+ ASSERT (Guid2 != NULL);
+
LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
@@ -164,6 +170,8 @@ IsZeroGuid (
UINT64 LowPartOfGuid;
UINT64 HighPartOfGuid;
+ ASSERT (Guid != NULL);
+
LowPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid);
HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
@@ -47,6 +47,9 @@ CopyGuid (
IN CONST GUID *SourceGuid
)
{
+ ASSERT (DestinationGuid != NULL);
+ ASSERT (SourceGuid != NULL);
+
WriteUnaligned64 (
(UINT64*)DestinationGuid,
ReadUnaligned64 ((CONST UINT64*)SourceGuid)
@@ -86,6 +89,9 @@ CompareGuid (
UINT64 HighPartOfGuid1;
UINT64 HighPartOfGuid2;
+ ASSERT (Guid1 != NULL);
+ ASSERT (Guid2 != NULL);
+
LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
@@ -164,6 +170,8 @@ IsZeroGuid (
UINT64 LowPartOfGuid;
UINT64 HighPartOfGuid;
+ ASSERT (Guid != NULL);
+
LowPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid);
HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
@@ -47,6 +47,9 @@ CopyGuid (
IN CONST GUID *SourceGuid
)
{
+ ASSERT (DestinationGuid != NULL);
+ ASSERT (SourceGuid != NULL);
+
WriteUnaligned64 (
(UINT64*)DestinationGuid,
ReadUnaligned64 ((CONST UINT64*)SourceGuid)
@@ -86,6 +89,9 @@ CompareGuid (
UINT64 HighPartOfGuid1;
UINT64 HighPartOfGuid2;
+ ASSERT (Guid1 != NULL);
+ ASSERT (Guid2 != NULL);
+
LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
@@ -164,6 +170,8 @@ IsZeroGuid (
UINT64 LowPartOfGuid;
UINT64 HighPartOfGuid;
+ ASSERT (Guid != NULL);
+
LowPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid);
HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
@@ -47,6 +47,9 @@ CopyGuid (
IN CONST GUID *SourceGuid
)
{
+ ASSERT (DestinationGuid != NULL);
+ ASSERT (SourceGuid != NULL);
+
WriteUnaligned64 (
(UINT64*)DestinationGuid,
ReadUnaligned64 ((CONST UINT64*)SourceGuid)
@@ -86,6 +89,9 @@ CompareGuid (
UINT64 HighPartOfGuid1;
UINT64 HighPartOfGuid2;
+ ASSERT (Guid1 != NULL);
+ ASSERT (Guid2 != NULL);
+
LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
@@ -164,6 +170,8 @@ IsZeroGuid (
UINT64 LowPartOfGuid;
UINT64 HighPartOfGuid;
+ ASSERT (Guid != NULL);
+
LowPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid);
HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
@@ -47,6 +47,9 @@ CopyGuid (
IN CONST GUID *SourceGuid
)
{
+ ASSERT (DestinationGuid != NULL);
+ ASSERT (SourceGuid != NULL);
+
WriteUnaligned64 (
(UINT64*)DestinationGuid,
ReadUnaligned64 ((CONST UINT64*)SourceGuid)
@@ -86,6 +89,9 @@ CompareGuid (
UINT64 HighPartOfGuid1;
UINT64 HighPartOfGuid2;
+ ASSERT (Guid1 != NULL);
+ ASSERT (Guid2 != NULL);
+
LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
@@ -164,6 +170,8 @@ IsZeroGuid (
UINT64 LowPartOfGuid;
UINT64 HighPartOfGuid;
+ ASSERT (Guid != NULL);
+
LowPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid);
HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
@@ -47,6 +47,9 @@ CopyGuid (
IN CONST GUID *SourceGuid
)
{
+ ASSERT (DestinationGuid != NULL);
+ ASSERT (SourceGuid != NULL);
+
WriteUnaligned64 (
(UINT64*)DestinationGuid,
ReadUnaligned64 ((CONST UINT64*)SourceGuid)
@@ -86,6 +89,9 @@ CompareGuid (
UINT64 HighPartOfGuid1;
UINT64 HighPartOfGuid2;
+ ASSERT (Guid1 != NULL);
+ ASSERT (Guid2 != NULL);
+
LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
@@ -164,6 +170,8 @@ IsZeroGuid (
UINT64 LowPartOfGuid;
UINT64 HighPartOfGuid;
+ ASSERT (Guid != NULL);
+
LowPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid);
HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
@@ -47,6 +47,9 @@ CopyGuid (
IN CONST GUID *SourceGuid
)
{
+ ASSERT (DestinationGuid != NULL);
+ ASSERT (SourceGuid != NULL);
+
WriteUnaligned64 (
(UINT64*)DestinationGuid,
ReadUnaligned64 ((CONST UINT64*)SourceGuid)
@@ -86,6 +89,9 @@ CompareGuid (
UINT64 HighPartOfGuid1;
UINT64 HighPartOfGuid2;
+ ASSERT (Guid1 != NULL);
+ ASSERT (Guid2 != NULL);
+
LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
@@ -164,6 +170,8 @@ IsZeroGuid (
UINT64 LowPartOfGuid;
UINT64 HighPartOfGuid;
+ ASSERT (Guid != NULL);
+
LowPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid);
HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
@@ -47,6 +47,9 @@ CopyGuid (
IN CONST GUID *SourceGuid
)
{
+ ASSERT (DestinationGuid != NULL);
+ ASSERT (SourceGuid != NULL);
+
WriteUnaligned64 (
(UINT64*)DestinationGuid,
ReadUnaligned64 ((CONST UINT64*)SourceGuid)
@@ -86,6 +89,9 @@ CompareGuid (
UINT64 HighPartOfGuid1;
UINT64 HighPartOfGuid2;
+ ASSERT (Guid1 != NULL);
+ ASSERT (Guid2 != NULL);
+
LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
@@ -164,6 +170,8 @@ IsZeroGuid (
UINT64 LowPartOfGuid;
UINT64 HighPartOfGuid;
+ ASSERT (Guid != NULL);
+
LowPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid);
HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
Add the ASSERT() statements to CopyGuid (), CompareGuid() and IsZeroGuid() that are mentioned in the respective comments but were missing from the actual code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> --- MdePkg/Library/BaseMemoryLib/MemLibGuid.c | 8 ++++++++ MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c | 8 ++++++++ MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c | 8 ++++++++ MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c | 8 ++++++++ MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c | 8 ++++++++ MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c | 8 ++++++++ MdePkg/Library/PeiMemoryLib/MemLibGuid.c | 8 ++++++++ MdePkg/Library/UefiMemoryLib/MemLibGuid.c | 8 ++++++++ 8 files changed, 64 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel