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

Function eval_or

dpdk/lib/bpf/bpf_validate.c:435–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433}
434
435static void
436eval_or(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, size_t opsz,
437 uint64_t msk)
438{
439 /* both operands are constants */
440 if (rd->u.min == rd->u.max && rs->u.min == rs->u.max) {
441 rd->u.min |= rs->u.min;
442 rd->u.max |= rs->u.max;
443 } else {
444 rd->u.max = eval_uor_max(rd->u.max, rs->u.max, opsz);
445 rd->u.min |= rs->u.min;
446 }
447
448 /* both operands are constants */
449 if (rd->s.min == rd->s.max && rs->s.min == rs->s.max) {
450 rd->s.min |= rs->s.min;
451 rd->s.max |= rs->s.max;
452
453 /* both operands are non-negative */
454 } else if (rd->s.min >= 0 || rs->s.min >= 0) {
455 rd->s.max = eval_uor_max(rd->s.max, rs->s.max, opsz);
456 rd->s.min |= rs->s.min;
457 } else
458 eval_smax_bound(rd, msk);
459}
460
461static void
462eval_xor(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