Repository navigation
Commit b118d66
Don't assume a curried int leaves tail padding in function
The test that `function`'s padding is at its end checks that a following
`char` fits in the tail padding of `function<int(char)>` and
`function<int(int)>`. On 32-bit x86, `function<int(int)>` has no tail
padding at all: its 8-byte factory storage, 4-byte operation-state
factory pointer and 4-byte `int` fill 16 bytes exactly, so the `char`
makes the enclosing object 20 bytes and the assertion fails. The
property under test still holds; the test assumed there was padding to
reuse.
This diff uses `function<int(short)>` instead, which has tail padding
wherever pointers are wider than two bytes: two bytes of it on 32-bit
x86 and six on x86-64.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 9be0310 commit b118d66
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1762 | 1762 | | |
1763 | 1763 | | |
1764 | 1764 | | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
1765 | 1768 | | |
1766 | 1769 | | |
1767 | 1770 | | |
1768 | | - | |
1769 | | - | |
| 1771 | + | |
| 1772 | + | |
1770 | 1773 | | |
1771 | 1774 | | |
1772 | | - | |
| 1775 | + | |
1773 | 1776 | | |
1774 | 1777 | | |
1775 | 1778 | | |
| |||
0 commit comments