Daniel Lehman : vcruntime140_1: Change pointer math in decode_uint.
Alexandre Julliard
julliard at winehq.org
Wed Jun 3 16:40:56 CDT 2020
Module: wine
Branch: master
Commit: 0f15bfee338d7926ad491969d23268f873c45cc5
URL: https://source.winehq.org/git/wine.git/?a=commit;h=0f15bfee338d7926ad491969d23268f873c45cc5
Author: Daniel Lehman <dlehman25 at gmail.com>
Date: Wed Jun 3 11:07:58 2020 +0200
vcruntime140_1: Change pointer math in decode_uint.
Signed-off-by: Daniel Lehman <dlehman25 at gmail.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/vcruntime140_1/except_x86_64.c | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/dlls/vcruntime140_1/except_x86_64.c b/dlls/vcruntime140_1/except_x86_64.c
index 2c1ed63152..48f824ae3f 100644
--- a/dlls/vcruntime140_1/except_x86_64.c
+++ b/dlls/vcruntime140_1/except_x86_64.c
@@ -117,34 +117,36 @@ typedef struct
static UINT decode_uint(BYTE **b)
{
UINT ret;
+ BYTE *p = *b;
- if ((**b & 1) == 0)
+ if ((*p & 1) == 0)
{
- ret = *b[0] >> 1;
- *b += 1;
+ ret = p[0] >> 1;
+ p += 1;
}
- else if ((**b & 3) == 1)
+ else if ((*p & 3) == 1)
{
- ret = (*b[0] >> 2) + (*b[1] << 6);
- *b += 2;
+ ret = (p[0] >> 2) + (p[1] << 6);
+ p += 2;
}
- else if ((**b & 7) == 3)
+ else if ((*p & 7) == 3)
{
- ret = (*b[0] >> 3) + (*b[1] << 5) + (*b[2] << 13);
- *b += 3;
+ ret = (p[0] >> 3) + (p[1] << 5) + (p[2] << 13);
+ p += 3;
}
- else if ((**b & 15) == 7)
+ else if ((*p & 15) == 7)
{
- ret = (*b[0] >> 4) + (*b[1] << 4) + (*b[2] << 12) + (*b[3] << 20);
- *b += 4;
+ ret = (p[0] >> 4) + (p[1] << 4) + (p[2] << 12) + (p[3] << 20);
+ p += 4;
}
else
{
FIXME("not implemented - expect crash\n");
ret = 0;
- *b += 5;
+ p += 5;
}
+ *b = p;
return ret;
}
More information about the wine-cvs
mailing list