bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: savestring() macro in general.h runs function arguments twice.


From: Chet Ramey
Subject: Re: savestring() macro in general.h runs function arguments twice.
Date: Mon, 26 Nov 2012 15:26:15 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121010 Thunderbird/16.0.1

On 11/24/12 2:32 AM, John E. Malmberg wrote:
> The execute_cmd.c module uses make_command_string() as a parameter to the
> savestring() macro.
> 
> This causes the savestring() macro to call that function twice().

Thanks, good catch.  I made the same temporary variable fix you did.

> I have not done any timing tests to see how this is impacting performance,
> but it definitely shows up when stepping through commands doing debugging.
> 
> This issue was first noticed in bash 1.14.7 and is also seen in the current
> bash 4.2.39.
> 
> I have locally patched execute_cmd.c to use an intermediate variable. The
> proper fix should probably be in general.h.

That's tough to do and still keep it in an expression context.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]