MCPcopy Create free account
hub / github.com/F-Stack/f-stack / eval_xor

Function eval_xor

dpdk/lib/bpf/bpf_validate.c:461–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459}
460
461static void
462eval_xor(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, size_t opsz,
463 uint64_t msk)
464{
465 /* both operands are constants */
466 if (rd->u.min == rd->u.max && rs->u.min == rs->u.max) {
467 rd->u.min ^= rs->u.min;
468 rd->u.max ^= rs->u.max;
469 } else {
470 rd->u.max = eval_uor_max(rd->u.max, rs->u.max, opsz);
471 rd->u.min = 0;
472 }
473
474 /* both operands are constants */
475 if (rd->s.min == rd->s.max && rs->s.min == rs->s.max) {
476 rd->s.min ^= rs->s.min;
477 rd->s.max ^= rs->s.max;
478
479 /* both operands are non-negative */
480 } else if (rd->s.min >= 0 || rs->s.min >= 0) {
481 rd->s.max = eval_uor_max(rd->s.max, rs->s.max, opsz);
482 rd->s.min = 0;
483 } else
484 eval_smax_bound(rd, msk);
485}
486
487static void
488eval_mul(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, size_t opsz,

Callers 1

eval_aluFunction · 0.85

Calls 2

eval_uor_maxFunction · 0.85
eval_smax_boundFunction · 0.85

Tested by

no test coverage detected