mirror of https://github.com/acidanthera/audk.git
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:
parent
f22e965895
commit
80d3139724
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue