Skip to content

Commit e7520d0

Browse files
authored
Merge pull request #8156 from tautschnig/features/__builtin_dynamic_object_size
Support __builtin_dynamic_object_size
2 parents 7232457 + 873727c commit e7520d0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Diff for: src/ansi-c/c_typecheck_expr.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -3519,11 +3519,15 @@ exprt c_typecheck_baset::do_special_functions(
35193519

35203520
return typecast_exprt(expr.arguments()[0], expr.type());
35213521
}
3522-
else if(identifier=="__builtin_object_size")
3522+
else if(
3523+
identifier == "__builtin_object_size" ||
3524+
identifier == "__builtin_dynamic_object_size")
35233525
{
3524-
// this is a gcc extension to provide information about
3526+
// These are gcc extensions to provide information about
35253527
// object sizes at compile time
35263528
// http://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html
3529+
// Our behavior is as if it was never possible to determine the object that
3530+
// the pointer pointed to.
35273531

35283532
if(expr.arguments().size()!=2)
35293533
{

Diff for: src/ansi-c/compiler_headers/gcc_builtin_headers_mem_string.h

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ void* __builtin_memmove(void*, const void*, __CPROVER_size_t);
119119
void* __builtin_mempcpy(void*, const void*, __CPROVER_size_t);
120120
void* __builtin_memset(void*, int, __CPROVER_size_t);
121121
__CPROVER_size_t __builtin_object_size(const void*, int);
122+
__CPROVER_size_t __builtin_dynamic_object_size(const void*, int);
122123
int __builtin_popcount(unsigned);
123124
int __builtin_popcountimax(uintmax_t);
124125
int __builtin_popcountll(unsigned long long int x);

0 commit comments

Comments
 (0)