Easier fix for 93925 (control.cc)

master
Liam Marshall 2015-05-15 13:31:20 -05:00
parent 4f1132e5a6
commit 1752fcee8c
1 changed files with 3 additions and 4 deletions

View File

@ -236,15 +236,14 @@ AbstractNode *ControlModule::instantiate(const Context* /*ctx*/, const ModuleIns
return node;
}
else if (value->type() == Value::RANGE) {
AbstractNode* node = new AbstractNode(inst);
Value::RangeType range = value->toRange();
boost::uint32_t steps = range.nbsteps();
boost::uint32_t steps = range.nbsteps();
if (steps >= 10000) {
PRINTB("WARNING: Bad range parameter for children: too many elements (%lu).", steps);
delete node;
return NULL;
}
for (Value::RangeType::iterator it = range.begin();it != range.end();it++) {
AbstractNode* node = new AbstractNode(inst);
for (Value::RangeType::iterator it = range.begin();it != range.end();it++) {
AbstractNode* childnode = getChild(Value(*it),modulectx); // with error cases
if (childnode==NULL) continue; // error
node->children.push_back(childnode);