| 323 | } |
| 324 | |
| 325 | static void |
| 326 | eval_rsh(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, size_t opsz, |
| 327 | uint64_t msk) |
| 328 | { |
| 329 | /* check if shift value is less then max result bits */ |
| 330 | if (rs->u.max >= opsz) { |
| 331 | eval_max_bound(rd, msk); |
| 332 | return; |
| 333 | } |
| 334 | |
| 335 | rd->u.max >>= rs->u.min; |
| 336 | rd->u.min >>= rs->u.max; |
| 337 | |
| 338 | /* check that dreg values are always positive */ |
| 339 | if ((uint64_t)rd->s.min >> (opsz - 1) != 0) |
| 340 | eval_smax_bound(rd, msk); |
| 341 | else { |
| 342 | rd->s.max >>= rs->u.min; |
| 343 | rd->s.min >>= rs->u.max; |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | static void |
| 348 | eval_arsh(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, size_t opsz, |
no test coverage detected