Skip to content

Fix UB in emplace functions#1160

Merged
grisumbras merged 4 commits into
boostorg:developfrom
grisumbras:fix/gcc-16-access-uninit
May 10, 2026
Merged

Fix UB in emplace functions#1160
grisumbras merged 4 commits into
boostorg:developfrom
grisumbras:fix/gcc-16-access-uninit

Conversation

@grisumbras
Copy link
Copy Markdown
Member

Fix #1157

@grisumbras grisumbras force-pushed the fix/gcc-16-access-uninit branch from 5b8619f to 7266731 Compare May 9, 2026 15:11
@cppalliance-bot
Copy link
Copy Markdown

cppalliance-bot commented May 9, 2026

An automated preview of the documentation is available at https://1160.json.prtest2.cppalliance.org/libs/json/doc/html/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-05-10 09:37:46 UTC

Plus some updates to valgrind CI settings.
@grisumbras grisumbras force-pushed the fix/gcc-16-access-uninit branch from 7266731 to ab1351a Compare May 9, 2026 15:30
@cppalliance-bot
Copy link
Copy Markdown

cppalliance-bot commented May 9, 2026

GCOVR code coverage report https://1160.json.prtest2.cppalliance.org/gcovr/index.html
LCOV code coverage report https://1160.json.prtest2.cppalliance.org/genhtml/index.html
Coverage Diff Report https://1160.json.prtest2.cppalliance.org/diff-report/index.html

Build time: 2026-05-10 09:54:48 UTC

@cppalliance-bot
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.91%. Comparing base (f356f13) to head (f299282).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1160   +/-   ##
========================================
  Coverage    93.90%   93.91%           
========================================
  Files           91       91           
  Lines         9256     9262    +6     
========================================
+ Hits          8692     8698    +6     
  Misses         564      564           
Files with missing lines Coverage Δ
include/boost/json/impl/value.ipp 98.49% <100.00%> (+0.01%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f356f13...f299282. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cppalliance-bot
Copy link
Copy Markdown

@cppalliance-bot
Copy link
Copy Markdown

@grisumbras grisumbras force-pushed the fix/gcc-16-access-uninit branch from b34e92b to ed5ab36 Compare May 10, 2026 06:15
@cppalliance-bot
Copy link
Copy Markdown

@grisumbras grisumbras force-pushed the fix/gcc-16-access-uninit branch from ed5ab36 to 43eab63 Compare May 10, 2026 08:40
With enough optimisations emplace functions accessed an object after its
lifetime has ended, due to order of evaluation. The fix is to make the
correct order correct.
@grisumbras grisumbras force-pushed the fix/gcc-16-access-uninit branch from 43eab63 to f299282 Compare May 10, 2026 09:31
@cppalliance-bot
Copy link
Copy Markdown

@grisumbras grisumbras changed the title GCC valgrind job in CI Fix UB in emplace functions May 10, 2026
@cppalliance-bot
Copy link
Copy Markdown

@grisumbras grisumbras merged commit f299282 into boostorg:develop May 10, 2026
5 checks passed
@grisumbras grisumbras deleted the fix/gcc-16-access-uninit branch May 10, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GCC 16.1.0 dead store elimination causes uninitialized memory accesses

2 participants