Function report |
Source Code:kernel\bpf\btf.c |
Create Date:2022-07-28 13:18:56 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:btf_array_resolve
Proto:static int btf_array_resolve(struct btf_verifier_env *env, const struct resolve_vertex *v)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct btf_verifier_env * | env | |
const struct resolve_vertex * | v |
2001 | array = btf_type_array(t) |
2008 | index_type_id = index_type |
2009 | index_type = btf_type_by_id(btf, index_type_id) |
2012 | btf_verifier_log_type(env, t, "Invalid index") |
2013 | Return -EINVAL |
2016 | If Not env_type_is_resolve_sink(env, index_type) && Not env_type_is_resolved(env, index_type_id) Then Return env_stack_push(env, index_type, index_type_id) |
2020 | index_type = btf_type_id_size(btf, & index_type_id, NULL) |
2021 | If Not index_type || Not btf_type_is_int(index_type) || Not Regular int is not a bit field and it must be either* u8/u16/u32/u64 or __int128. Then |
2023 | btf_verifier_log_type(env, t, "Invalid index") |
2024 | Return -EINVAL |
2028 | elem_type_id = type |
2029 | elem_type = btf_type_by_id(btf, elem_type_id) |
2032 | btf_verifier_log_type(env, t, "Invalid elem") |
2034 | Return -EINVAL |
2037 | If Not env_type_is_resolve_sink(env, elem_type) && Not env_type_is_resolved(env, elem_type_id) Then Return env_stack_push(env, elem_type, elem_type_id) |
2041 | elem_type = btf_type_id_size(btf, & elem_type_id, & elem_size) |
2042 | If Not elem_type Then |
2043 | btf_verifier_log_type(env, t, "Invalid elem") |
2044 | Return -EINVAL |
2048 | btf_verifier_log_type(env, t, "Invalid array of int") |
2049 | Return -EINVAL |
2053 | btf_verifier_log_type(env, t, "Array size overflows U32_MAX") |
2055 | Return -EINVAL |
2058 | env_stack_pop_resolved(env, elem_type_id, elem_size * nelems) |
2060 | Return 0 |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |