Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pub
frama-c
Commits
1a8010cf
Commit
1a8010cf
authored
Mar 05, 2019
by
Julien Signoles
Browse files
[runtime] fix pre-invokation of calloc (as for malloc in a previous commit)
parent
bedbdcbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/e-acsl/share/e-acsl/segment_model/e_acsl_segment_tracking.h
View file @
1a8010cf
...
...
@@ -894,11 +894,16 @@ extern int MSPACES_INIT;
* behaviour is as if the size were some non-zero value, except that the
* returned pointer shall not be used to access an object." */
void
*
malloc
(
size_t
size
)
{
mspaces_init
();
size_t
alloc_size
=
ALLOC_SIZE
(
size
);
/* Return NULL if the size is too large to be aligned */
char
*
res
=
alloc_size
?
(
char
*
)
public_malloc
(
alloc_size
)
:
NULL
;
char
*
res
;
if
(
alloc_size
)
{
mspaces_init
();
res
=
(
char
*
)
public_malloc
(
alloc_size
);
}
else
res
=
NULL
;
if
(
res
)
{
/* Make sure there is sufficient room in shadow */
...
...
@@ -920,8 +925,12 @@ void* calloc(size_t nmemb, size_t size) {
/* Since aligned size is required by the model do the allocation through
* `malloc` and nullify the memory space by hand */
char
*
res
=
size
?
(
char
*
)
public_malloc
(
alloc_size
)
:
NULL
;
char
*
res
;
if
(
size
)
{
mspaces_init
();
res
=
(
char
*
)
public_malloc
(
alloc_size
);
}
else
res
=
NULL
;
if
(
res
)
{
/* Make sure there is sufficient room in shadow */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment