type_name:job allocates on the stack
|User & Date:||luismachuca 2019-02-26 13:42:25|
- Change foundin to "<91"
- Change icomment to:
library/type_name.hpp line 30: the header provides typeid demangle, however for compilers using cxxabi (eg.: GCC), it calls abi::__cxa_demangle with a buffer allocated on the stack.
char buf; // <-- error is this size_t size=sizeof(buf); int status; char* res = abi::__cxa_demangle (name, buf, &size, &status);
Relevant quotes from the cxxabi documentation:
output_buffer A region of memory, allocated with malloc, of *length bytes, into which the demangled name is stored.
The caller is responsible for deallocating this memory using free.
Sourced by  referencing .
- Change login to "luismachuca"
- Change mimetype to "text/x-fossil-wiki"
- Change severity to "Critical"
- Change status to "Open"
- Change title to "type_name:job allocates on the stack"
- Change type to "Code_Defect"