verifier检查规则清单
检查规则 |
错误ID |
描述 |
修改建议 |
|---|---|---|---|
函数枚举参数检查 |
ENUM.INVALID |
enum argument must be enum constant or integer literal |
检查枚举参数是否为常量或整数。 |
ENUM.VALUE |
enum argument must be within valid range |
检查枚举参数在不在有效范围内。 |
|
函数返回值检查 |
RET.INVALID.TYPE |
return memory must be casted to a const pointer to struct |
不可直接用u8 *类型的变量接收返回值,应使用结构体指针类型。 |
RET.INVALID.SIZE |
size of struct must match with size of return memory |
强转的结构体的大小必须等于内存空间大小,大于小于都不行。 |
|
RET.INVALID.COPY |
invalid memory copy function usage |
使用memcpy_s函数读取内存,count不能超出大小、不能是变量、不能是一个计算表达式。 |
|
RET.FORBID.DEREF |
cannot dereference a pointer to return memory |
不可对接收返回值的指针变量进行解引用操作。 |
|
RET.FORBID.INDEX |
cannot index into a pointer to return memory |
不能数组索引形式访问接收返回值的指针变量。 |
|
函数入参检查 |
PARAM.INVALID.SIZE |
size of struct must match with size of parameter |
结构体的大小必须与接口函数的入参大小相等。 |
PARAM.INVALID.COPY |
invalid memory copy function usage |
使用memcpy_s函数读写内存数据时,size不能超过内存大小、count不能超出大小、不能是变量、不能是一个计算表达式。 |
|
PARAM.FORBID.DEREF |
cannot dereference this pointer |
不可对内存入参指针进行解引用操作。 |
|
PARAM.FORBID.INDEX |
cannot index into a pointer to this variable |
禁止以数组索引形式访问接口函数入参指向的内存。 |
|
const类型转换检查 |
CONST.INVALID.CAST |
cannot cast const type to non-const type |
禁止将const类型强转成非const类型。 |
汇编码检查 |
INLINE.ASSEMBLY |
inline assembly codes found |
禁止内嵌汇编码。 |