Dear Andre, This is OK for trunk. I have not been keeping track of whether or not you have commit rights yet. If not, I will get to it sometime this week.
Thanks for the patch. Paul On 10 January 2015 at 15:59, Andre Vehreschild <ve...@gmx.de> wrote: > Hi all, > > attached patch fixes the bug reported in pr 60334. The issue here was that the > function's result being (a pointer to) a deferred length char array. The > string > length for the result value was wrapped in a local variable, whose value was > never written back to the string length of the result. This lead the calling > routine to take the length of the result to be random leading to a crash. > > This patch addresses the issue by preventing the instantiation of the local > var and instead using a reference to the parameter. This not only saves one > value on the stack, but also because for small functions the compiler will > hold > all parameters in registers for a significant level of optimization, all the > overhead of memory access (I hope :-). > > Bootstraps and regtests ok on x86_64-linux-gnu. > > - Andre > -- > Andre Vehreschild * Kreuzherrenstr. 8 * 52062 Aachen > Tel.: +49 241 9291018 * Email: ve...@gmx.de -- Outside of a dog, a book is a man's best friend. Inside of a dog it's too dark to read. Groucho Marx