[Bug sanitizer/113531] New: AddressSanitizer: stack-use-after-scope when iterating over initializer list

2024-01-21 Thread gcc at pauldreik dot se via Gcc-bugs
: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: gcc at pauldreik dot se CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org

[Bug libstdc++/111163] signed integer overflow in std::format("{:%S}",std::chrono::duration....)

2023-08-26 Thread gcc at pauldreik dot se via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63 --- Comment #2 from Paul Dreik --- The fmt lib had the same problem. I wrote a safe duration cast which eventually morphed into this: https://github.com/fmtlib/fmt/blob/9b74160817f2bc63288d2111e823a35dd3dbf234/include/fmt/chrono.h#L57-L68

[Bug libstdc++/111163] New: signed integer overflow in std::format("{:%S}",std::chrono::duration....)

2023-08-26 Thread gcc at pauldreik dot se via Gcc-bugs
Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: gcc at pauldreik dot se Target Milestone: --- The following program: #include #include int main() { [[maybe_unused]] auto blah = std::format( &q

[Bug libstdc++/111162] New: signed integer overflow triggered by std::chrono::parse

2023-08-26 Thread gcc at pauldreik dot se via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: gcc at pauldreik dot se Target Milestone: --- The following program: #include #include #include int main() { std::istringstream is("21474837"); std::chrono::minutes

[Bug libstdc++/111102] New: illegal pointer arithmetic invoked by std::format("L{:65536}",1)

2023-08-22 Thread gcc at pauldreik dot se via Gcc-bugs
ty: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: gcc at pauldreik dot se Target Milestone: --- The following program: #include constexpr auto blah = std::format(L"{:65536}", 1); is problematic when com

[Bug libstdc++/110860] std::format("{:f}",2e304) invokes undefined behaviour

2023-08-15 Thread gcc at pauldreik dot se via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110860 --- Comment #19 from Paul Dreik --- Thanks Jonathan! I am happy to count myself as a gcc contributor now :-D Never mind the tiny git mistake, that will be forgotten once gcc 14 is out!

[Bug libstdc++/110860] std::format("{:f}",2e304) invokes undefined behaviour

2023-08-12 Thread gcc at pauldreik dot se via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110860 --- Comment #12 from Paul Dreik --- The last fix is unfortunately not sufficient either, because for abs(__v)<1 log10 becomes negative and that wont convert gracefully to size_t. I implemented the following fix, which avoids log10 and uses frex

[Bug libstdc++/110860] std::format("{:f}",2e304) invokes undefined behaviour

2023-08-11 Thread gcc at pauldreik dot se via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110860 --- Comment #8 from Paul Dreik --- I do unfortunately not think the fix is entirely correct. When 0 is passed, log10 returns -inf, which can not be converted to an integer. I had a bit of problem to reproduce this with gcc, but it worked with

[Bug libstdc++/110974] format out of bounds read on invalid format string "{:{}."

2023-08-10 Thread gcc at pauldreik dot se via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110974 --- Comment #1 from Paul Dreik --- This is very similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110862 which has already been fixed on trunk.

[Bug libstdc++/110974] New: format out of bounds read on invalid format string "{:{}."

2023-08-10 Thread gcc at pauldreik dot se via Gcc-bugs
ty: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: gcc at pauldreik dot se Target Milestone: --- The following code: #include #include #include int main() { double v = 0; // use a char buffer instead of

[Bug libstdc++/110968] New: format out of bounds read on format("{:05L}",-1.f)

2023-08-10 Thread gcc at pauldreik dot se via Gcc-bugs
iority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: gcc at pauldreik dot se Target Milestone: --- The following program: #include #include int main() { float v = -1; std::puts(std::vformat("{:05L}", std::make_format_args(v)).c_str

[Bug libstdc++/110862] format out of bands read on format string "{0:{0}"

2023-08-01 Thread gcc at pauldreik dot se via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110862 --- Comment #2 from Paul Dreik --- (In reply to 康桓瑋 from comment #1) > It does throw: > > https://godbolt.org/z/5q3bb51YE Sorry for being unclear. Yes, it throws but that is after the out of bounds read has happened.

[Bug libstdc++/110862] New: format out of bands read on format string "{0:{0}"

2023-07-31 Thread gcc at pauldreik dot se via Gcc-bugs
iority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: gcc at pauldreik dot se Target Milestone: --- The following program with an incorrect format string causes an out of bounds read when compiled with gcc 13.2: #include #include int main() { unsi

[Bug libstdc++/110860] New: std::format("{:f}",2e304) invokes undefined behaviour

2023-07-31 Thread gcc at pauldreik dot se via Gcc-bugs
iority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: gcc at pauldreik dot se Target Milestone: --- The following program, compiled with gcc 13.2: #include #include int main() { std::puts(std::format("{:f}",2e304).c_str()); } causes

[Bug c++/67631] brace initialization bug

2016-11-12 Thread gcc at pauldreik dot se
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67631 --- Comment #3 from Paul Dreik --- This is still present in trunk, rev 242335 g++-trunk (GCC) 7.0.0 20161112 (experimental)

[Bug c++/67631] brace initialization bug

2016-11-12 Thread gcc at pauldreik dot se
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67631 Paul Dreik changed: What|Removed |Added CC||gcc at pauldreik dot se --- Comment #2