Fix global reference assignment

This commit is contained in:
Jason Turner
2016-04-16 14:30:12 -06:00
parent 10b984556d
commit 83c6df11f0

View File

@@ -295,8 +295,13 @@ namespace chaiscript
try {
if (lhs.is_undef()) {
if (!this->children.empty()
&& this->children[0]->identifier == AST_Node_Type::Reference)
if ((!this->children.empty()
&& ((this->children[0]->identifier == AST_Node_Type::Reference)
|| (!this->children[0]->children.empty()
&& this->children[0]->children[0]->identifier == AST_Node_Type::Reference)
)
)
)
{
/// \todo This does not handle the case of an unassigned reference variable
/// being assigned outside of its declaration