Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
03cb20e5
Commit
03cb20e5
authored
Apr 02, 2021
by
Jim Wilson
Committed by
Kito Cheng
Apr 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 2 C++ coroutine testcases from upstream.
Fixes use-after-free bugs exposed by new glibc version.
parent
c3911e64
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C
+8
-4
gcc/testsuite/g++.dg/coroutines/torture/pr95519-05-gro.C
+1
-1
No files found.
gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C
View file @
03cb20e5
...
...
@@ -5,20 +5,23 @@
#include "../coro.h"
int
g_promise
=
-
1
;
template
<
typename
R
,
typename
HandleRef
,
typename
...
T
>
struct
std
::
coroutine_traits
<
R
,
HandleRef
,
T
...
>
{
struct
promise_type
{
promise_type
(
HandleRef
h
,
T
...
args
)
{
h
=
std
::
coroutine_handle
<
promise_type
>::
from_promise
(
*
this
);
PRINT
(
"Created Promise"
);
g_promise
=
1
;
}
~
promise_type
()
{
PRINT
(
"Destroyed Promise"
);
g_promise
=
0
;}
void
get_return_object
()
{}
auto
initial_suspend
()
{
return
std
::
suspend_always
{};
}
auto
final_suspend
()
{
return
std
::
suspend_never
{};
}
auto
final_suspend
()
noexcept
{
return
std
::
suspend_never
{};
}
void
return_void
()
{}
void
unhandled_exception
()
{}
...
...
@@ -46,9 +49,10 @@ int main ()
// initial suspend.
h
.
resume
();
if
(
!
h
.
done
())
// The coro should have self-destructed.
if
(
g_promise
)
{
PRINT
(
"main: apparently w
asn't don
e..."
);
PRINT
(
"main: apparently w
e did not complet
e..."
);
abort
();
}
...
...
gcc/testsuite/g++.dg/coroutines/torture/pr95519-05-gro.C
View file @
03cb20e5
...
...
@@ -5,7 +5,7 @@
struct
pt_b
{
std
::
suspend_always
initial_suspend
()
const
noexcept
{
return
{};
}
std
::
suspend_
never
final_suspend
()
const
noexcept
{
return
{};
}
std
::
suspend_
always
final_suspend
()
const
noexcept
{
return
{};
}
constexpr
void
return_void
()
noexcept
{};
constexpr
void
unhandled_exception
()
const
noexcept
{}
};
...
...
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