neo_solidity/ir/statements/assignments/
array_store.rs

1fn lower_array_store(
2    target: &Expression,
3    rhs: &Expression,
4    ctx: &mut LoweringContext,
5    instructions: &mut Vec<Instruction>,
6) {
7    if let Expression::ArraySubscript(_, array, Some(index)) = target {
8        let checkpoint = instructions.len();
9        if lower_expression(array, ctx, instructions)
10            && lower_expression(index, ctx, instructions)
11            && lower_expression(rhs, ctx, instructions)
12        {
13            instructions.push(Instruction::ArraySet);
14            return;
15        }
16        instructions.truncate(checkpoint);
17    }
18
19    load_expression(rhs, ctx, instructions);
20    instructions.push(Instruction::Drop(ValueType::Any));
21}
22