Opened 12 years ago
Closed 11 years ago
#4717 closed Patches (fixed)
Non-const local static variable stored_vtable
Reported by: | Owned by: | Douglas Gregor | |
---|---|---|---|
Milestone: | Boost 1.46.0 | Component: | function |
Version: | Boost 1.44.0 | Severity: | Regression |
Keywords: | Cc: | viboes |
Description
In boost/function/function_template.hpp, there is a local static object stored_vtable which is initialized statically. Since this variable is not const, it is placed in writable memory (or section).
This can be a critical problem on some embedded, ROM environment which has only XX KB of RAM. The variable is small, but instanciated for each combination of template arguments.
Digging the history, this variable was const in old versions, but was changed to non-const in r43884 (accidentally, I think). After that, some changes in r43884 were reverted in r49326, but the constness was left as non-const. I believe that this was just an oversight.
Attachments (1)
Change History (6)
comment:1 by , 12 years ago
Type: | Patches → Bugs |
---|
by , 12 years ago
Attachment: | djw_function_const_vtable.patch added |
---|
comment:2 by , 12 years ago
Cc: | added |
---|---|
Milestone: | To Be Determined → Boost-1.46.0 |
Type: | Bugs → Patches |
comment:3 by , 12 years ago
I applied this patch locally; it passed regressions on gcc 4.2.1 and clang TOT
comment:5 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Implements a const stored_vtable. Passes regressions on gcc 4.2, msvc 7.1, 10.0