bug-bash
[Top][All Lists]
Advanced

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

Re: Executing 'return' inside RETURN trap causes function to recurse inf


From: Chet Ramey
Subject: Re: Executing 'return' inside RETURN trap causes function to recurse infinitely
Date: Mon, 10 Mar 2014 09:14:20 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.1.1

On 3/9/14 2:57 PM, Dan Douglas wrote:

>> Cause the function call to recurse infinitely. I would understand if
>> this is labeled as a feature, rather than a bug (in the sense that
>> the user shouldn't be putting return inside a return trap :), so one
>> can safely assume that if they did it, it's because they wanted the
>> infinite recursion).
>>
        [...]
> 
> I know we've discussed this off-list, but I'll restate that I've known
> about this for a long time and never considered it a bug. The return
> status currently remains that of the last command or return evaluated
> prior to the trap, which is consistent with my reading of the spec.

While it was clearly not the original intention of the code, the current
behavior has been in place for many years.  I know how to change it if
and when I want, but for now I will leave it alone.

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]