Skip to content

Commit 3a577d7

Browse files
tautschnigDaniel Kroening
authored and
Daniel Kroening
committed
Add a definition of alloca
Benchmarks not including headers files fail as we only provided a definition of __builtin_alloca, which alloca expands to in standard libary headers, but none for alloca directly.
1 parent 1a970e3 commit 3a577d7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/ansi-c/library/stdlib.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,18 @@ inline void *__builtin_alloca(__CPROVER_size_t alloca_size)
147147
return res;
148148
}
149149

150+
/* FUNCTION: alloca */
151+
152+
#undef alloca
153+
154+
void *__builtin_alloca(__CPROVER_size_t alloca_size);
155+
156+
inline void *alloca(__CPROVER_size_t alloca_size)
157+
{
158+
__CPROVER_HIDE:;
159+
return __builtin_alloca(alloca_size);
160+
}
161+
150162
/* FUNCTION: free */
151163

152164
#undef free

0 commit comments

Comments
 (0)