Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
bc270a54
Commit
bc270a54
authored
Jul 03, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Correctly handle shift greater than the type width in 64-bit shift functions.
Based on a patch by Zhao Yi.
parent
9ef72462
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
large_int.c
dlls/ntdll/large_int.c
+9
-0
large_int.c
dlls/ntdll/tests/large_int.c
+5
-5
No files found.
dlls/ntdll/large_int.c
View file @
bc270a54
...
...
@@ -817,6 +817,9 @@ LONGLONG __stdcall __regs__allshl( LONGLONG a, unsigned char b )
if
(
b
>=
32
)
{
if
(
b
>=
64
)
ret
.
HighPart
=
0
;
else
ret
.
HighPart
=
x
.
LowPart
<<
(
b
&
31
);
ret
.
LowPart
=
0
;
}
...
...
@@ -847,6 +850,9 @@ LONGLONG __stdcall __regs__allshr( LONGLONG a, unsigned char b )
if
(
b
>=
32
)
{
ret
.
HighPart
=
x
.
HighPart
>>
31
;
if
(
b
>=
64
)
ret
.
LowPart
=
x
.
HighPart
>>
31
;
else
ret
.
LowPart
=
x
.
HighPart
>>
(
b
&
31
);
}
else
...
...
@@ -876,6 +882,9 @@ ULONGLONG __stdcall __regs__aullshr( ULONGLONG a, unsigned char b )
if
(
b
>=
32
)
{
ret
.
HighPart
=
0
;
if
(
b
>=
64
)
ret
.
LowPart
=
0
;
else
ret
.
LowPart
=
x
.
HighPart
>>
(
b
&
31
);
}
else
...
...
dlls/ntdll/tests/large_int.c
View file @
bc270a54
...
...
@@ -526,10 +526,10 @@ static void test_builtins(void)
ok
(
l
==
0xbcdef00000000000ll
,
"got %#I64x
\n
"
,
l
);
l
=
call_shift_func
(
p_allshl
,
0x0123456789abcdefll
,
88
);
todo_wine
ok
(
!
l
,
"got %#I64x
\n
"
,
l
);
ok
(
!
l
,
"got %#I64x
\n
"
,
l
);
l
=
call_shift_func
(
p_allshl
,
0x0123456789abcdefll
,
0x88
);
todo_wine
ok
(
!
l
,
"got %#I64x
\n
"
,
l
);
ok
(
!
l
,
"got %#I64x
\n
"
,
l
);
l
=
call_shift_func
(
p_allshl
,
0x0123456789abcdefll
,
0x108
);
ok
(
l
==
0x23456789abcdef00ll
,
"got %#I64x
\n
"
,
l
);
...
...
@@ -541,7 +541,7 @@ static void test_builtins(void)
ok
(
l
==
0x01234ll
,
"got %#I64x
\n
"
,
l
);
l
=
call_shift_func
(
p_allshr
,
0x0123456789abcdefll
,
88
);
todo_wine
ok
(
!
l
,
"got %#I64x
\n
"
,
l
);
ok
(
!
l
,
"got %#I64x
\n
"
,
l
);
l
=
call_shift_func
(
p_allshr
,
0x8123456789abcdefll
,
12
);
ok
(
l
==
0xfff8123456789abcll
,
"got %#I64x
\n
"
,
l
);
...
...
@@ -550,7 +550,7 @@ static void test_builtins(void)
ok
(
l
==
0xfffffffffff81234ll
,
"got %#I64x
\n
"
,
l
);
l
=
call_shift_func
(
p_allshr
,
0x8123456789abcdefll
,
88
);
todo_wine
ok
(
l
==
-
1ll
,
"got %#I64x
\n
"
,
l
);
ok
(
l
==
-
1ll
,
"got %#I64x
\n
"
,
l
);
l
=
call_shift_func
(
p_allshr
,
0x8123456789abcdefll
,
0x108
);
ok
(
l
==
0xff8123456789abcdll
,
"got %#I64x
\n
"
,
l
);
...
...
@@ -562,7 +562,7 @@ static void test_builtins(void)
ok
(
l
==
0x81234ll
,
"got %#I64x
\n
"
,
l
);
l
=
call_shift_func
(
p_aullshr
,
0x8123456789abcdefll
,
88
);
todo_wine
ok
(
!
l
,
"got %#I64x
\n
"
,
l
);
ok
(
!
l
,
"got %#I64x
\n
"
,
l
);
l
=
call_shift_func
(
p_aullshr
,
0x8123456789abcdefll
,
0x108
);
ok
(
l
==
0x8123456789abcdll
,
"got %#I64x
\n
"
,
l
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment