Built-ins

This section lists all the built-ins that can be used with the -val-builtin options, and all the other functions that can be called from the source code to either view results or control the value analysis. The functions are declared in <tis_builtin.h> so this file has to be included in the calling source file.

Abstract values

These functions can be called to build abstract values as inputs for the value analysis as explained in the Write an Entry Point section of the User Manual:

  • double tis_abstract_double(double __nmin, double __nmax, double __pmin, double __pmax, int __nzero, int __pzero, int __ninf, int __pinf, int __nan);
  • float tis_abstract_float(float __nmin, float __nmax, float __pmin, float __pmax, int __nzero, int __pzero, int __ninf, int __pinf, int __nan);
  • char tis_char_interval(char __min, char __max);
  • double tis_double_interval(double __min, double __max);
  • float tis_float_interval(float __min, float __max);
  • int tis_int_interval(int __min, int __max);
  • int tis_interval(int __min, int __max);
  • long tis_long_interval(long __min, long __max);
  • long long tis_long_long_interval(long long __min, long long __max);
  • void tis_make_unknown(char *__p, unsigned long __l);
  • int tis_nondet(int __a, int __b);
  • inline static void *tis_nondet_ptr(void *__a, void *__b);
  • unsigned char tis_unsigned_char_interval(unsigned char __min, unsigned char __max);
  • unsigned int tis_unsigned_int_interval(unsigned int __min, unsigned int __max);
  • unsigned long tis_unsigned_long_interval(unsigned long __min, unsigned long __max);
  • unsigned long long tis_unsigned_long_long_interval(unsigned long long __min, unsigned long long __max);
  • unsigned short tis_unsigned_short_interval(unsigned short __min, unsigned short __max);

Watchpoints

These functions can be used to set watchpoints as explained in the Watchpoints section:

  • void tis_detect_imprecise_pointer(void *__p);
  • void tis_watch_address(void *__p, unsigned long __s, int __n);
  • void tis_watch_cardinal(void *__p, unsigned long __s, unsigned long long __maximal_cardinal, int __n);
  • void tis_watch_garbled(void *__p, unsigned long __s, int __n);
  • void tis_watch_value(void *__p, unsigned long __s, int __forbidden_value, int __n);

Analysis function

More functions are available to either view results or control the value analysis:

  • __tis_copy_block (internal built-in for normalization)
  • __tis_vla_alloc (internal built-in for normalization)
  • __tis_vla_free (internal built-in for normalization)
  • void *tis_base_addr(void *__p);
  • unsigned int tis_block_size(void const *__p);
  • void tis_check_included(void const *__src1, unsigned long __n, void const *__src2);
  • void tis_check_leak(void);
  • tis_degenerate_or_inject (not declared)
  • void tis_dump_assert_each(void);
  • void tis_dump_assignments_each(void);
  • void tis_dump_each(void);
  • void tis_dump_each_file(char *__name, ...);
  • void (*tis_find_function(char const *__name, char const *__file))(void);
  • void *tis_find_variable(char const *__name, char const *__file);
  • unsigned long long tis_id(void);
  • void tis_init_type(char const *__type, void *__ptr, unsigned long __depth, unsigned long __width, enum tis_valid_pointer __valid_pointers);
  • char *tis_inject_file(char const *__filename, unsigned long *__size);
  • int tis_interval_split(int __min, int __max);
  • tis_load_state (not declared)
  • void tis_make_uninitialized(char *__p, unsigned long __l);
  • void tis_pretty(void const *__P, ...);
  • void tis_print_subexps(char const *__description, ...);
  • int tis_ptr_is_less_than(void const *__p1, void const *__p2);
  • int tis_ptr_is_within(void const *__p, void const *__start, void const *__end);
  • void tis_sa_dump_each(void);
  • void tis_sa_show_each();
  • void tis_show_allocated(void);
  • void tis_show_allocated_and_id(char const *__msg, ...);
  • void tis_show_each(char const *__msg, ...);
  • void tis_show_recursively_each(void const *__P);
  • void tis_ub(char const *__msg, int __test);
  • void tis_variable_split(void *__p, unsigned long __s, int __limit);

Standard library function

These functions are built-ins for the C standard library functions. Some of them are set by default in tis-analyzer, tis-interpreter or both.

Built-in C function Is default
tis__exit _exit yes
tis_acos acos yes
tis_asin asin yes
tis_asprintf_interpreter asprintf interpreter only
tis_atan2 atan2 yes
tis_atan atan yes
tis_atof_interpreter atof interpreter only
tis_atoi_interpreter atoi interpreter only
tis_atol_interpreter atol interpreter only
tis_atoll_interpreter atoll interpreter only
tis_bzero bzero no
tis_ceil ceil yes
tis_ceilf ceilf yes
tis_cos cos yes
tis_cos_precise cos no
tis_exp exp yes
tis_expf expf yes
tis_floor floor yes
tis_floorf floorf yes
tis_fmax fmax yes
tis_fmin fmin yes
tis_fmod fmod yes
tis_fprintf fprintf no
tis_hypot hypot no
tis_log10 log10 yes
tis_log10f log10f yes
tis_log log yes
tis_logf logf yes
tis_memchr memchr yes
tis_memcmp memcmp yes
tis_memcpy memcpy yes
tis_memmove memmove yes
tis_memset memset yes
tis_nan nan yes
tis_nanf nanf yes
tis_pow pow yes
tis_powf powf yes
tis_printf printf yes
tis_realloc realloc yes
tis_realloc_multiple realloc no
tis_round round yes
tis_roundf roundf yes
tis_scanf_interpreter scanf interpreter only
tis_sin sin yes
tis_sin_precise sin no
tis_snprintf snprintf yes
tis_sprintf sprintf yes
tis_sqrt sqrt yes
tis_sqrtf sqrtf yes
tis_sscanf_interpreter sscanf interpreter only
tis_strcat strcat yes
tis_strchr strchr yes
tis_strcmp strcmp yes
tis_strcpy strcpy yes
tis_strlen strlen yes
tis_strncat strncat yes
tis_strncmp strncmp yes
tis_strncpy strncpy yes
tis_strnlen strnlen yes
tis_strtod_interpreter strtod interpreter only
tis_strtof_interpreter strtof interpreter only
tis_strtol_interpreter strtol interpreter only
tis_strtold_interpreter strtold no
tis_strtoll_interpreter strtoll interpreter only
tis_strtoul_interpreter strtoul interpreter only
tis_strtoull_interpreter strtoull interpreter only
tis_swprintf swprintf yes
tis_tan tan yes
tis_trunc trunc yes
tis_truncf truncf yes
tis_vasprintf_interpreter vasprintf interpreter only
tis_vfprintf vfprintf no
tis_vprintf vprintf yes
tis_vsnprintf vsnprintf yes
tis_vsprintf vsprintf yes
tis_vwprintf vwprintf yes
tis_wcscat wcscat yes
tis_wcschr wcschr yes
tis_wcscmp wcscmp yes
tis_wcscpy wcscpy yes
tis_wcslen wcslen yes
tis_wcsncat wcsncat yes
tis_wcsncmp wcsncmp yes
tis_wcsncpy wcsncpy yes
tis_wcsnlen wcsnlen yes
tis_wmemcpy wmemcpy yes
tis_wmemmove wmemmove yes
tis_wprintf wprintf yes

More built-ins are available for allocation functions, and they are documented in <tis_builtin.h>:

  • __builtin_operator_delete
  • __builtin_operator_new
  • tis_alloc
  • tis_alloc_safe
  • tis_alloc_size
  • tis_alloc_size_weak
  • tis_alloc_weak
  • tis_delete
  • tis_delete_array
  • tis_free
  • tis_new
  • tis_new_array

Dependencies

These functions can be called to show computed dependencies:

  • void tis_deps_show_deps(void);
  • void tis_deps_show_file_generalizable_bytes(void);
  • void tis_deps_show_open_pathdeps(void);
  • void tis_deps_show_pathdeps(void);