ArmPkg/BaseMemoryLib(Sym|Vstm): Do not post increment returned pointer

InternalMemScanMem(8|16|32|64) was returning a pointer that was
post incremented from the expected returned value.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
Reviewed-by: Ronald Cron <ronald.cron@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17108 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Olivier Martin 2015-04-02 13:51:28 +00:00 committed by oliviermartin
parent f22e965895
commit 80d3139724
2 changed files with 16 additions and 8 deletions

View File

@ -162,9 +162,10 @@ InternalMemScanMem8 (
Pointer = (CONST UINT8*)Buffer;
do {
if (*(Pointer++) == Value) {
if (*Pointer == Value) {
return Pointer;
}
Pointer++;
} while (--Length != 0);
return NULL;
}
@ -192,9 +193,10 @@ InternalMemScanMem16 (
Pointer = (CONST UINT16*)Buffer;
do {
if (*(Pointer++) == Value) {
if (*Pointer == Value) {
return Pointer;
}
Pointer++;
} while (--Length != 0);
return NULL;
}
@ -222,9 +224,10 @@ InternalMemScanMem32 (
Pointer = (CONST UINT32*)Buffer;
do {
if (*(Pointer++) == Value) {
if (*Pointer == Value) {
return Pointer;
}
Pointer++;
} while (--Length != 0);
return NULL;
}
@ -252,9 +255,10 @@ InternalMemScanMem64 (
Pointer = (CONST UINT64*)Buffer;
do {
if (*(Pointer++) == Value) {
if (*Pointer == Value) {
return Pointer;
}
Pointer++;
} while (--Length != 0);
return NULL;
}

View File

@ -162,9 +162,10 @@ InternalMemScanMem8 (
Pointer = (CONST UINT8*)Buffer;
do {
if (*(Pointer++) == Value) {
if (*Pointer == Value) {
return Pointer;
}
Pointer++;
} while (--Length != 0);
return NULL;
}
@ -192,9 +193,10 @@ InternalMemScanMem16 (
Pointer = (CONST UINT16*)Buffer;
do {
if (*(Pointer++) == Value) {
if (*Pointer == Value) {
return Pointer;
}
Pointer++;
} while (--Length != 0);
return NULL;
}
@ -222,9 +224,10 @@ InternalMemScanMem32 (
Pointer = (CONST UINT32*)Buffer;
do {
if (*(Pointer++) == Value) {
if (*Pointer == Value) {
return Pointer;
}
Pointer++;
} while (--Length != 0);
return NULL;
}
@ -252,9 +255,10 @@ InternalMemScanMem64 (
Pointer = (CONST UINT64*)Buffer;
do {
if (*(Pointer++) == Value) {
if (*Pointer == Value) {
return Pointer;
}
Pointer++;
} while (--Length != 0);
return NULL;
}