File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -289,7 +289,9 @@ std::shared_ptr<Block> Compiler::inputBlock(int id) const
289289/* ! Returns the index of the given variable. */
290290unsigned int Compiler::variableIndex (std::shared_ptr<Entity> varEntity)
291291{
292+ assert (varEntity);
292293 auto var = dynamic_cast <Variable *>(varEntity.get ());
294+ assert (var);
293295 auto it = std::find (impl->variables .begin (), impl->variables .end (), var);
294296 if (it != impl->variables .end ())
295297 return it - impl->variables .begin ();
Original file line number Diff line number Diff line change @@ -34,10 +34,12 @@ void InputValue::compile(Compiler *compiler)
3434 break ;
3535
3636 case Type::Variable:
37+ assert (impl->valuePtr );
3738 compiler->addInstruction (vm::OP_READ_VAR, { compiler->variableIndex (impl->valuePtr ) });
3839 break ;
3940
4041 case Type::List:
42+ assert (impl->valuePtr );
4143 compiler->addInstruction (vm::OP_READ_LIST, { compiler->listIndex (impl->valuePtr ) });
4244 break ;
4345
You can’t perform that action at this time.
0 commit comments