Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
5c6e3214
Commit
5c6e3214
authored
10 years ago
by
Julien Signoles
Browse files
Options
Downloads
Patches
Plain Diff
[memory model] fix bug #1838 about memset
parent
72f9bfb7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/e-acsl/doc/Changelog
+1
-0
1 addition, 0 deletions
src/plugins/e-acsl/doc/Changelog
src/plugins/e-acsl/share/e-acsl/memory_model/e_acsl_mmodel.c
+3
-3
3 additions, 3 deletions
src/plugins/e-acsl/share/e-acsl/memory_model/e_acsl_mmodel.c
with
4 additions
and
3 deletions
src/plugins/e-acsl/doc/Changelog
+
1
−
0
View file @
5c6e3214
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
# E-ACSL: the Whole E-ACSL plug-in
# E-ACSL: the Whole E-ACSL plug-in
###############################################################################
###############################################################################
-* E-ACSL [2014/08/05] Fix bug #1838 about memset.
-* E-ACSL [2014/08/05] Fix bug #1818 about initialization of globals.
-* E-ACSL [2014/08/05] Fix bug #1818 about initialization of globals.
-* E-ACSL [2014/08/04] Fix bug #1696 by clarifying the manual.
-* E-ACSL [2014/08/04] Fix bug #1696 by clarifying the manual.
-* E-ACSL [2014/08/04] Fix bug #1831 about argc and argv.
-* E-ACSL [2014/08/04] Fix bug #1831 about argc and argv.
...
...
This diff is collapsed.
Click to expand it.
src/plugins/e-acsl/share/e-acsl/memory_model/e_acsl_mmodel.c
+
3
−
3
View file @
5c6e3214
...
@@ -47,7 +47,7 @@ void __warning(const char* fct_name) {
...
@@ -47,7 +47,7 @@ void __warning(const char* fct_name) {
}
}
void
*
__e_acsl_memset
(
void
*
dest
,
int
val
,
size_t
len
)
{
void
*
__e_acsl_
mmodel_
memset
(
void
*
dest
,
int
val
,
size_t
len
)
{
unsigned
char
*
ptr
=
(
unsigned
char
*
)
dest
;
unsigned
char
*
ptr
=
(
unsigned
char
*
)
dest
;
while
(
len
--
>
0
)
while
(
len
--
>
0
)
*
ptr
++
=
val
;
*
ptr
++
=
val
;
...
@@ -175,7 +175,7 @@ void* __realloc(void* ptr, size_t size) {
...
@@ -175,7 +175,7 @@ void* __realloc(void* ptr, size_t size) {
else
{
else
{
int
nb
=
needed_bytes
(
size
);
int
nb
=
needed_bytes
(
size
);
tmp
->
init_ptr
=
malloc
(
nb
);
tmp
->
init_ptr
=
malloc
(
nb
);
__e_acsl_memset
(
tmp
->
init_ptr
,
0xFF
,
nb
);
__e_acsl_
mmodel_
memset
(
tmp
->
init_ptr
,
0xFF
,
nb
);
if
(
size
%
8
!=
0
)
if
(
size
%
8
!=
0
)
tmp
->
init_ptr
[
size
/
8
]
<<=
(
8
-
size
%
8
);
tmp
->
init_ptr
[
size
/
8
]
<<=
(
8
-
size
%
8
);
}
}
...
@@ -242,7 +242,7 @@ void __initialize (void * ptr, size_t size) {
...
@@ -242,7 +242,7 @@ void __initialize (void * ptr, size_t size) {
if
(
tmp
->
init_cpt
==
0
)
{
if
(
tmp
->
init_cpt
==
0
)
{
int
nb
=
needed_bytes
(
tmp
->
size
);
int
nb
=
needed_bytes
(
tmp
->
size
);
tmp
->
init_ptr
=
malloc
(
nb
);
tmp
->
init_ptr
=
malloc
(
nb
);
__e_acsl_memset
(
tmp
->
init_ptr
,
0
,
nb
);
__e_acsl_
mmodel_
memset
(
tmp
->
init_ptr
,
0
,
nb
);
}
}
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
i
=
0
;
i
<
size
;
i
++
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment