bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] UserFunction_header::remove_duplicate_local_var


From: Juergen Sauermann
Subject: Re: [Bug-apl] UserFunction_header::remove_duplicate_local_var
Date: Sat, 21 Nov 2015 12:40:35 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Hi Kevin,

thanks, fixed in SVN 691.

/// Jürgen


On 11/21/2015 09:13 AM, Kevin Anderson wrote:
Sorry about that last; accidentally sent in mid-compose!  Here's how it should have read.
 
In remove_duplicate_local_var,
 
Suggest:
    while (pos < local_vars.size(); ++pos) {
        if (sym == local_vars[pos]) {
            local_vars[pos] = local_vars.back();
            local_vars.pop_back();
        } else
            ++pos

    }
instead of:

    for (; pos < local_vars.size(); ++pos) {
        if (sym == local_vars[pos]) {



            local_vars[pos] = local_vars.back(); 
                      //[KA] Probable bug here
                      //[KA] local_vars[pos] still duplicates sym 
                      //[KA] if local_vars.back() also == sym









            local_vars.pop_back();
        }
    }
Two examples of headers which should elicit the issue:
 
FUN;LV;LV;LV
FUN B;LV;B;B


reply via email to

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