• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bemanproject / big_int / 32397899474
92%

Build:
DEFAULT BRANCH: main
Ran 20 Aug 2026 05:40PM UTC
Jobs 1
Files 28
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Aug 2026 05:29PM UTC coverage: 96.519% (-0.01%) from 96.53%
32397899474

push

github

web-flow
Make assignment strong against a throwing allocation (#338)

* Make assignment strong against a throwing allocation

assign_value's slow path released the destination's buffer and published the
source's limb count before allocating, so a throw from alloc_limbs left the
control words describing freed storage. Reading it was a heap-buffer-overflow in
width_mag, destroying it was a double free, and on an inline destination the
value silently read as 0 and the next assignment overflowed the inline array.

The two branches that adopt existing storage now publish their control words
after that storage is in place. The fresh-allocation branch secures the new block
first, which leaves the destination unchanged on a throw rather than merely
valid.

Allocating first needs care when the allocator propagates, because the new block
has to come from the source's allocator while the old one still has to be
released with ours. Allocating through a copy of the source's allocator handles
that: [allocator.requirements.general] requires allocator copy construction not
to exit via an exception and gives a1 == a, and storage from equal allocators is
mutually deallocatable, so the block is releasable through m_alloc afterwards.
alloc_limbs is split into a static alloc_limbs_from taking the allocator
explicitly, with alloc_limbs forwarding to it.

Nothing between the allocation and the publication can throw: copy_n_to_allocation
is nothrow because the limb type is pinned to a builtin unsigned integer,
deallocate is required not to throw, and the propagating allocator assignment is
required not to throw when the trait is true.

The propagating path had no coverage at all, since no allocator in the suite set
propagate_on_container_copy_assignment. Three tests in allocation.test.cpp add a
stateful propagating allocator: one covers the fresh-allocation path, one the
move-assignment steal, and one arms a throw to check the destination keeps both
its value and its allocator.

* Dr... (continued)

13 of 15 new or added lines in 1 file covered. (86.67%)

1 existing line in 1 file now uncovered.

6044 of 6262 relevant lines covered (96.52%)

3137651.32 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
93.48
-0.03% include/beman/big_int/big_int.hpp

Coverage Regressions

Lines Coverage ∆ File
1
93.48
-0.03% include/beman/big_int/big_int.hpp
Jobs
ID Job ID Ran Files Coverage
1 32397899474.1 20 Aug 2026 05:40PM UTC 28
96.52
GitHub Action Run
Source Files on build 32397899474
  • Tree
  • List 28
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #32397899474
  • 8eb6692f on github
  • Prev Build on main (#32397404887)
  • Next Build on main (#32401507605)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc