On Tue, Nov 12, 2013 at 11:24 AM, Uros Bizjak <ubiz...@gmail.com> wrote: > > This was uncovered by x86 lto-profiledbootstrap. The patch allows > lto-profiledbootstrap to proceed further. > > 2013-11-12 Uros Bizjak <ubiz...@gmail.com> > > * cp-demangle.c (d_copy_templates): Cast result of malloc > to (struct d_print_template *). > (d_print_comp): Cast result of realloc to (struct d_saved scope *). > > Tested on x86_64-pc-linux-gnu. > > OK for mainline?
The patch is OK, but this code is troubling. I obviously should have looked at it earlier. The C++ demangler is sometimes used in panic situations, when malloc is not available. The interface was designed to be usable without requiring malloc, by passing in a sufficiently large buffer. I'm concerned that we apparently now require malloc to work. Ian