Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
b228f16c
Commit
b228f16c
authored
Apr 24, 2017
by
Sebastian Lackner
Committed by
Alexandre Julliard
Apr 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vcomp: Handle begin == NULL in _vcomp_for_static_init.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
11a1ceeb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
main.c
dlls/vcomp/main.c
+7
-0
vcomp.c
dlls/vcomp/tests/vcomp.c
+48
-0
No files found.
dlls/vcomp/main.c
View file @
b228f16c
...
...
@@ -1171,10 +1171,17 @@ void CDECL _vcomp_for_static_init(int first, int last, int step, int chunksize,
struct
vcomp_team_data
*
team_data
=
thread_data
->
team
;
int
num_threads
=
team_data
?
team_data
->
num_threads
:
1
;
int
thread_num
=
thread_data
->
thread_num
;
int
no_begin
,
no_lastchunk
;
TRACE
(
"(%d, %d, %d, %d, %p, %p, %p, %p, %p)
\n
"
,
first
,
last
,
step
,
chunksize
,
loops
,
begin
,
end
,
next
,
lastchunk
);
if
(
!
begin
)
{
begin
=
&
no_begin
;
lastchunk
=
&
no_lastchunk
;
}
if
(
num_threads
==
1
&&
chunksize
!=
1
)
{
*
loops
=
1
;
...
...
dlls/vcomp/tests/vcomp.c
View file @
b228f16c
...
...
@@ -1002,6 +1002,30 @@ static void CDECL for_static_cb(void)
p_vcomp_for_static_end
();
p_vcomp_barrier
();
loops
=
end
=
next
=
lastchunk
=
0xdeadbeef
;
p_vcomp_for_static_init
(
tests
[
i
].
first
,
tests
[
i
].
last
,
tests
[
i
].
step
,
tests
[
i
].
chunksize
,
&
loops
,
NULL
,
&
end
,
&
next
,
&
lastchunk
);
if
(
broken_flags
&
VCOMP_FOR_STATIC_BROKEN_LOOP
)
{
ok
(
loops
==
0
||
loops
==
1
,
"test %d, thread %d/%d: expected loops == 0 or 1, got %u
\n
"
,
i
,
thread_num
,
num_threads
,
loops
);
}
else
{
ok
(
loops
==
my_loops
,
"test %d, thread %d/%d: expected loops == %u, got %u
\n
"
,
i
,
thread_num
,
num_threads
,
my_loops
,
loops
);
ok
(
end
==
my_end
,
"test %d, thread %d/%d: expected end == %d, got %d
\n
"
,
i
,
thread_num
,
num_threads
,
my_end
,
end
);
ok
(
next
==
my_next
||
broken
(
broken_flags
&
VCOMP_FOR_STATIC_BROKEN_NEXT
),
"test %d, thread %d/%d: expected next == %d, got %d
\n
"
,
i
,
thread_num
,
num_threads
,
my_next
,
next
);
ok
(
lastchunk
==
0xdeadbeef
,
"test %d, thread %d/%d: expected lastchunk == 0xdeadbeef, got %d
\n
"
,
i
,
thread_num
,
num_threads
,
lastchunk
);
}
p_vcomp_for_static_end
();
p_vcomp_barrier
();
if
(
tests
[
i
].
first
==
tests
[
i
].
last
)
continue
;
my_loops
=
my_begin
=
my_end
=
my_next
=
my_lastchunk
=
0xdeadbeef
;
...
...
@@ -1032,6 +1056,30 @@ static void CDECL for_static_cb(void)
p_vcomp_for_static_end
();
p_vcomp_barrier
();
loops
=
end
=
next
=
lastchunk
=
0xdeadbeef
;
p_vcomp_for_static_init
(
tests
[
i
].
last
,
tests
[
i
].
first
,
tests
[
i
].
step
,
tests
[
i
].
chunksize
,
&
loops
,
NULL
,
&
end
,
&
next
,
&
lastchunk
);
if
(
broken_flags
&
VCOMP_FOR_STATIC_BROKEN_LOOP
)
{
ok
(
loops
==
0
||
loops
==
1
,
"test %d, thread %d/%d: expected loops == 0 or 1, got %u
\n
"
,
i
,
thread_num
,
num_threads
,
loops
);
}
else
{
ok
(
loops
==
my_loops
,
"test %d, thread %d/%d: expected loops == %u, got %u
\n
"
,
i
,
thread_num
,
num_threads
,
my_loops
,
loops
);
ok
(
end
==
my_end
,
"test %d, thread %d/%d: expected end == %d, got %d
\n
"
,
i
,
thread_num
,
num_threads
,
my_end
,
end
);
ok
(
next
==
my_next
||
broken
(
broken_flags
&
VCOMP_FOR_STATIC_BROKEN_NEXT
),
"test %d, thread %d/%d: expected next == %d, got %d
\n
"
,
i
,
thread_num
,
num_threads
,
my_next
,
next
);
ok
(
lastchunk
==
0xdeadbeef
,
"test %d, thread %d/%d: expected lastchunk == 0xdeadbeef, got %d
\n
"
,
i
,
thread_num
,
num_threads
,
lastchunk
);
}
p_vcomp_for_static_end
();
p_vcomp_barrier
();
}
}
...
...
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