Modify dubious? c++ iterator increment which was causing a crash on ARM
This commit is contained in:
parent
25eda37bc9
commit
c42fe8c105
@ -1689,13 +1689,20 @@ bool RclConfig::processFilterCmd(std::vector<std::string>& cmd) const
|
|||||||
bool hasinterp = !stringlowercmp("python", *it) ||
|
bool hasinterp = !stringlowercmp("python", *it) ||
|
||||||
!stringlowercmp("perl", *it);
|
!stringlowercmp("perl", *it);
|
||||||
|
|
||||||
*it++ = findFilter(*it);
|
// Note that, if the cmd vector size is 1, post-incrementing the
|
||||||
|
// iterator in the following statement, which works on x86, leads
|
||||||
|
// to a crash on ARM with gcc 6 and 8 (at least), which does not
|
||||||
|
// seem right (it should just become cmd.end() ?) but
|
||||||
|
// whatever... We do it later then.
|
||||||
|
*it = findFilter(*it);
|
||||||
|
|
||||||
if (hasinterp) {
|
if (hasinterp) {
|
||||||
if (cmd.size() < 2) {
|
if (cmd.size() < 2) {
|
||||||
LOGERR("processFilterCmd: python/perl cmd: no script?. [" <<
|
LOGERR("processFilterCmd: python/perl cmd: no script?. [" <<
|
||||||
stringsToString(cmd) << "]\n");
|
stringsToString(cmd) << "]\n");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
++it;
|
||||||
*it = findFilter(*it);
|
*it = findFilter(*it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user