1
0
Fork 0

assign register in constructor

This commit is contained in:
Jan Steemann 2014-10-02 17:35:43 +02:00
parent eae877b1be
commit 31005892d2
2 changed files with 9 additions and 15 deletions

View File

@ -1486,19 +1486,6 @@ int EnumerateListBlock::initialize () {
return res;
}
auto en = reinterpret_cast<EnumerateListNode const*>(_exeNode);
// get the inVariable register id . . .
// planRegisters() has been run, so getPlanNode()->_varOverview is set up
auto it = getPlanNode()->getVarOverview()->varInfo.find(en->_inVariable->id);
if (it == getPlanNode()->getVarOverview()->varInfo.end()){
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "variable not found");
}
_inVarRegId = (*it).second.registerId;
TRI_ASSERT(_inVarRegId < ExecutionNode::MaxRegisterId);
return TRI_ERROR_NO_ERROR;
}

View File

@ -645,9 +645,16 @@ namespace triagens {
public:
EnumerateListBlock (ExecutionEngine* engine,
EnumerateListNode const* ep)
: ExecutionBlock(engine, ep) {
EnumerateListNode const* en)
: ExecutionBlock(engine, en),
_inVarRegId(ExecutionNode::MaxRegisterId) {
auto it = en->getVarOverview()->varInfo.find(en->_inVariable->id);
if (it == en->getVarOverview()->varInfo.end()){
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "variable not found");
}
_inVarRegId = (*it).second.registerId;
TRI_ASSERT(_inVarRegId < ExecutionNode::MaxRegisterId);
}
~EnumerateListBlock () {