private VariableResolveResult Node_Expr_PropertyFetch(XmlNode node)
{
var varNode = node.GetSubNode(AstConstants.Subnode + ":" + AstConstants.Subnodes.Var);
var variable = GetVariable(varNode.GetSubNodesByPrefix(AstConstants.Node).Single());
var nameNode = node.GetSubNode(AstConstants.Subnode + ":" + AstConstants.Subnodes.Name);
if (nameNode.TryGetSubNode(AstConstants.Scalar + ":" + AstConstants.Scalars.String, out nameNode))
{
Variable property;
if (variable.Variable.Info.TryGetVariableByString(nameNode.InnerText, out property))
{
return new VariableResolveResult(property);
}
property = new Variable(nameNode.InnerText, VariableScope.Instance);
property.Info.NestedVariableDefaultTaintFactory = variable.Variable.Info.NestedVariableDefaultTaintFactory;
property.Info.Taints = variable.Variable.Info.NestedVariableDefaultTaintFactory();
property.Info.NestedVariablePossibleStoredDefaultTaintFactory = variable.Variable.Info.NestedVariablePossibleStoredDefaultTaintFactory;
property.Info.PossibleStoredTaint = ClonePossibleStored(variable.Variable.Info);
variable.Variable.Info.Variables.Add(new VariableTreeDimension() { Key = property.Name }, property);
return new VariableResolveResult(property, true);
}
return new VariableResolveResult(new Variable("$UNKNOWN$", VariableScope.Instance), true);
}