power_of_two: Track variables which are powers of two
PATCH 1/1 power_of_two: Track variables which are powers of two
smatch_power_of_two tracks variables which are powers of two and also handles exceptions such as sign extensions.
Signed-off-by Harshvardhan Jha <[email protected]>
--- Makefile | 1 + check_list.h | 1 + smatch.h | 2 + smatch_power_of_two.c | 167 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 171 insertions(+) create mode 100644 smatch_power_of_two.c
Makefile +1 -0
@@ -303,6 +303,7 @@ SMATCH_OBJS += smatch_parse_call_math.o SMATCH_OBJS += smatch_parsed_conditions.o SMATCH_OBJS += smatch_passes_array_size.o SMATCH_OBJS += smatch_points_to_user_data.o +SMATCH_OBJS += smatch_power_of_two.o SMATCH_OBJS += smatch_project.o SMATCH_OBJS += smatch_ranges.o SMATCH_OBJS += smatch_real_absolute.o
check_list.h +1 -0
@@ -57,6 +57,7 @@ CK(register_integer_overflow_links) CK(register_real_absolute) CK(register_imaginary_absolute) CK(register_bits) +CK(register_power_of_two) CK(register_fn_arg_link) CK(register_parameter_names) CK(register_return_to_param)
smatch.h +2 -0
@@ -848,6 +848,8 @@ enum info_type {FRESH_ALLOC =1044 ,ALLOCATOR =1045 ,FUNC_TIME =1047 , +POWER_OF_TWO =1048 , +POWER_OF_TWO_SET =1049 ,/* put random temporary stuff in the 7000-7999 range for testing */ USER_DATA = 8017,
smatch_power_of_two.c new file +167 -0
167 lines not on this page · raw message
Signature · 1 line
2.32.0