On Tue, Mar 26, 2019 at 7:07 PM Jiong Wang <jiong.w...@netronome.com> wrote:
> Some code inside current implementation of "propagate_liveness" is a little
> bit verbose.
>
> This patch refactor them so the code looks more simple and more clear.
>
> The redundant usage of "vparent->frame[vstate->curframe]" is removed as we
> are here. It is safe to do this because "state_equal" has guaranteed that
> vstate->curframe must be equal with vparent->curframe.
[...]
> @@ -6050,6 +6050,22 @@ static bool states_equal(struct bpf_verifier_env *env,
>         return true;
>  }
>
> +static int propagate_liveness_reg(struct bpf_verifier_env *env,
> +                                 struct bpf_reg_state *reg,
> +                                 struct bpf_reg_state *parent_reg, u8 flag)

This function takes four arguments...

[...]
> @@ -6071,16 +6088,13 @@ static int propagate_liveness(struct bpf_verifier_env 
> *env,
[...]
> +               err = propagate_liveness_reg(env, &regs[i], &parent_regs[i]);

.. but both here...

[...]
> @@ -6089,11 +6103,13 @@ static int propagate_liveness(struct bpf_verifier_env 
> *env,
[...]
> +                       err = propagate_liveness_reg(env, reg, parent_reg);

... and here you only pass in three arguments? Does this compile?

Reply via email to