Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support __builtin_dynamic_object_size #8156

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/ansi-c/c_typecheck_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3512,11 +3512,15 @@ exprt c_typecheck_baset::do_special_functions(

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

if(expr.arguments().size()!=2)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ void* __builtin_memmove(void*, const void*, __CPROVER_size_t);
void* __builtin_mempcpy(void*, const void*, __CPROVER_size_t);
void* __builtin_memset(void*, int, __CPROVER_size_t);
__CPROVER_size_t __builtin_object_size(const void*, int);
__CPROVER_size_t __builtin_dynamic_object_size(const void*, int);
int __builtin_popcount(unsigned);
int __builtin_popcountimax(uintmax_t);
int __builtin_popcountll(unsigned long long int x);
Expand Down
Loading