protected override void VisitStoreElement(StoreElement downNode, object o) { StructValue idx = this.state.Stack.Pop() as StructValue; ObjectReferenceValue arr = this.state.Stack.Pop() as ObjectReferenceValue; PointerValue ptr = new PointerToElementValue(arr.Obj as Array, SpecializingVisitor.toInt(idx)); this.storeVar(downNode, ptr, o); }
protected override void VisitNewArray(NewArray downNode, object o) { PointerToNode ptrUpNode = (o as Data).PointerToNode; StructValue idx = this.state.Stack.Pop() as StructValue; Array arr = Array.CreateInstance(downNode.Type, SpecializingVisitor.toInt(idx)); ObjectReferenceValue obj = new ObjectReferenceValue(arr); if (Annotation.GetArrayElementsBTType(downNode) == BTType.Dynamic) { for (int i = 0; i < SpecializingVisitor.toInt(idx); i++) { Variable varUp = this.mbbUp.Variables.CreateVar(downNode.Type, VariableKind.Local); this.varsHash[new PointerToElementValue(arr, i)] = varUp; ptrUpNode = SpecializingVisitor.initVariable(varUp, ptrUpNode); } } this.state.Stack.Push(obj); this.AddTask(downNode.Next, ptrUpNode); }