Skip to content

Commit ef2a222

Browse files
author
aleck099
committed
Test: Address sanitizer: container-overflow
Reproduce on msvc 2022 with address sanitizer on
1 parent 471da25 commit ef2a222

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Compile on msvc 2022 with address sanitizer on
3+
* Produces container-overflow
4+
*/
5+
#include <string>
6+
#include <fast_io.h>
7+
8+
using namespace fast_io::io;
9+
10+
void print_all() {
11+
using namespace fast_io::mnp;
12+
std::u16string full_name;
13+
{
14+
fast_io::u16ostring_ref o1(&full_name);
15+
for (std::u16string_view f : { u"", u"benchmark", u"0001.refterm" }) {
16+
if (!full_name.empty())
17+
print(o1, u"/");
18+
print(o1, f);
19+
}
20+
}
21+
perrln(code_cvt(full_name));
22+
}
23+
24+
int main() {
25+
print_all();
26+
}

0 commit comments

Comments
 (0)