bug-apl
[Top][All Lists]
Advanced

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

[Bug-apl] UserFunction_header::remove_duplicate_local_var


From: Kevin Anderson
Subject: [Bug-apl] UserFunction_header::remove_duplicate_local_var
Date: Sat, 21 Nov 2015 00:13:12 -0800

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]