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
5294dde9
Commit
5294dde9
authored
9 years ago
by
Kostyantyn Vorobyov
Browse files
Options
Downloads
Patches
Plain Diff
Removed several duplicate assertions in memory model
parent
3ea34db5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/e-acsl/share/e-acsl/memory_model/e_acsl_mmodel.c
+6
-18
6 additions, 18 deletions
src/plugins/e-acsl/share/e-acsl/memory_model/e_acsl_mmodel.c
with
6 additions
and
18 deletions
src/plugins/e-acsl/share/e-acsl/memory_model/e_acsl_mmodel.c
+
6
−
18
View file @
5294dde9
...
@@ -112,9 +112,7 @@ void* __store_block(void* ptr, size_t size) {
...
@@ -112,9 +112,7 @@ void* __store_block(void* ptr, size_t size) {
/* remove the block starting at ptr */
/* remove the block starting at ptr */
void
__delete_block
(
void
*
ptr
)
{
void
__delete_block
(
void
*
ptr
)
{
struct
_block
*
tmp
;
struct
_block
*
tmp
=
__get_exact
(
ptr
);
assert
(
ptr
!=
NULL
);
tmp
=
__get_exact
(
ptr
);
assert
(
tmp
!=
NULL
);
assert
(
tmp
!=
NULL
);
__clean_init
(
tmp
);
__clean_init
(
tmp
);
__remove_element
(
tmp
);
__remove_element
(
tmp
);
...
@@ -293,11 +291,9 @@ void __literal_string (void * ptr) {
...
@@ -293,11 +291,9 @@ void __literal_string (void * ptr) {
/* return whether the size bytes of ptr are initialized */
/* return whether the size bytes of ptr are initialized */
int
__initialized
(
void
*
ptr
,
size_t
size
)
{
int
__initialized
(
void
*
ptr
,
size_t
size
)
{
struct
_block
*
tmp
;
unsigned
i
;
unsigned
i
;
assert
(
ptr
!=
NULL
);
assert
(
size
>
0
);
assert
(
size
>
0
);
tmp
=
__get_cont
(
ptr
);
struct
_block
*
tmp
=
__get_cont
(
ptr
);
if
(
tmp
==
NULL
)
if
(
tmp
==
NULL
)
return
false
;
return
false
;
...
@@ -318,9 +314,7 @@ int __initialized (void * ptr, size_t size) {
...
@@ -318,9 +314,7 @@ int __initialized (void * ptr, size_t size) {
/* return the length (in bytes) of the block containing ptr */
/* return the length (in bytes) of the block containing ptr */
size_t
__block_length
(
void
*
ptr
)
{
size_t
__block_length
(
void
*
ptr
)
{
struct
_block
*
tmp
;
struct
_block
*
tmp
=
__get_cont
(
ptr
);
assert
(
ptr
!=
NULL
);
tmp
=
__get_cont
(
ptr
);
assert
(
tmp
!=
NULL
);
assert
(
tmp
!=
NULL
);
return
tmp
->
size
;
return
tmp
->
size
;
}
}
...
@@ -351,26 +345,20 @@ int __valid_read(void* ptr, size_t size) {
...
@@ -351,26 +345,20 @@ int __valid_read(void* ptr, size_t size) {
/* return the base address of the block containing ptr */
/* return the base address of the block containing ptr */
void
*
__base_addr
(
void
*
ptr
)
{
void
*
__base_addr
(
void
*
ptr
)
{
struct
_block
*
tmp
;
struct
_block
*
tmp
=
__get_cont
(
ptr
);
assert
(
ptr
!=
NULL
);
tmp
=
__get_cont
(
ptr
);
assert
(
tmp
!=
NULL
);
assert
(
tmp
!=
NULL
);
return
(
void
*
)
tmp
->
ptr
;
return
(
void
*
)
tmp
->
ptr
;
}
}
/* return the offset of ptr within its block */
/* return the offset of ptr within its block */
int
__offset
(
void
*
ptr
)
{
int
__offset
(
void
*
ptr
)
{
struct
_block
*
tmp
;
struct
_block
*
tmp
=
__get_cont
(
ptr
);
assert
(
ptr
!=
NULL
);
tmp
=
__get_cont
(
ptr
);
assert
(
tmp
!=
NULL
);
assert
(
tmp
!=
NULL
);
return
((
size_t
)
ptr
-
tmp
->
ptr
);
return
((
size_t
)
ptr
-
tmp
->
ptr
);
}
}
void
__out_of_bound
(
void
*
ptr
,
_Bool
flag
)
{
void
__out_of_bound
(
void
*
ptr
,
_Bool
flag
)
{
struct
_block
*
tmp
;
struct
_block
*
tmp
=
__get_cont
(
ptr
);
assert
(
ptr
!=
NULL
);
tmp
=
__get_cont
(
ptr
);
assert
(
tmp
!=
NULL
);
assert
(
tmp
!=
NULL
);
tmp
->
is_out_of_bound
=
flag
;
tmp
->
is_out_of_bound
=
flag
;
}
}
...
...
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