* report unreachable instructions. */
| 1930 | * report unreachable instructions. |
| 1931 | */ |
| 1932 | static void |
| 1933 | log_unreachable(const struct bpf_verifier *bvf) |
| 1934 | { |
| 1935 | uint32_t i; |
| 1936 | struct inst_node *node; |
| 1937 | const struct ebpf_insn *ins; |
| 1938 | |
| 1939 | for (i = 0; i != bvf->prm->nb_ins; i++) { |
| 1940 | |
| 1941 | node = bvf->in + i; |
| 1942 | ins = bvf->prm->ins + i; |
| 1943 | |
| 1944 | if (node->colour == WHITE && |
| 1945 | ins->code != (BPF_LD | BPF_IMM | EBPF_DW)) |
| 1946 | RTE_BPF_LOG(ERR, "unreachable code at pc: %u;\n", i); |
| 1947 | } |
| 1948 | } |
| 1949 | |
| 1950 | /* |
| 1951 | * report loops detected. |