Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cwe_checker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
cwe_checker
Commits
a6e5fa65
Unverified
Commit
a6e5fa65
authored
Sep 04, 2020
by
Enkelmann
Committed by
GitHub
Sep 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify object list implementation (#84)
parent
9f0bc45b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
8 deletions
+5
-8
tests.rs
...hecker_rs/src/analysis/pointer_inference/context/tests.rs
+1
-4
object_list.rs
cwe_checker_rs/src/analysis/pointer_inference/object_list.rs
+0
-0
mod.rs
cwe_checker_rs/src/analysis/pointer_inference/state/mod.rs
+4
-4
No files found.
cwe_checker_rs/src/analysis/pointer_inference/context/tests.rs
View file @
a6e5fa65
...
@@ -177,10 +177,7 @@ fn context_problem_implementation() {
...
@@ -177,10 +177,7 @@ fn context_problem_implementation() {
.unwrap
();
.unwrap
();
assert_eq!
(
return_state
.stack_id
,
new_id
(
"main"
,
"RSP"
));
assert_eq!
(
return_state
.stack_id
,
new_id
(
"main"
,
"RSP"
));
assert_eq!
(
return_state
.caller_stack_ids
,
BTreeSet
::
new
());
assert_eq!
(
return_state
.caller_stack_ids
,
BTreeSet
::
new
());
assert_eq!
(
assert_eq!
(
return_state
.memory
,
state
.memory
);
return_state
.memory
.get_internal_id_map
(),
state
.memory
.get_internal_id_map
()
);
assert_eq!
(
assert_eq!
(
return_state
.get_register
(
&
register
(
"RSP"
))
.unwrap
(),
return_state
.get_register
(
&
register
(
"RSP"
))
.unwrap
(),
state
.get_register
(
&
register
(
"RSP"
))
.unwrap
()
state
.get_register
(
&
register
(
"RSP"
))
.unwrap
()
...
...
cwe_checker_rs/src/analysis/pointer_inference/object_list.rs
View file @
a6e5fa65
This diff is collapsed.
Click to expand it.
cwe_checker_rs/src/analysis/pointer_inference/state/mod.rs
View file @
a6e5fa65
...
@@ -159,8 +159,8 @@ impl State {
...
@@ -159,8 +159,8 @@ impl State {
referenced_ids
.append
(
&
mut
self
.caller_stack_ids
.clone
());
referenced_ids
.append
(
&
mut
self
.caller_stack_ids
.clone
());
referenced_ids
.append
(
&
mut
self
.ids_known_to_caller
.clone
());
referenced_ids
.append
(
&
mut
self
.ids_known_to_caller
.clone
());
referenced_ids
=
self
.add_recursively_referenced_ids_to_id_set
(
referenced_ids
);
referenced_ids
=
self
.add_recursively_referenced_ids_to_id_set
(
referenced_ids
);
// remove unreferenced
ID
s
// remove unreferenced
object
s
self
.memory
.remove_unused_
id
s
(
&
referenced_ids
);
self
.memory
.remove_unused_
object
s
(
&
referenced_ids
);
}
}
/// Search (recursively) through all memory objects referenced by the given IDs
/// Search (recursively) through all memory objects referenced by the given IDs
...
@@ -190,7 +190,7 @@ impl State {
...
@@ -190,7 +190,7 @@ impl State {
/// Merge the callee stack with the caller stack.
/// Merge the callee stack with the caller stack.
///
///
/// This deletes the
pointer from the callee_id to the corresponding memory object
/// This deletes the
memory object corresponding to the callee_id
/// and updates all other references pointing to the callee_id to point to the caller_id.
/// and updates all other references pointing to the callee_id to point to the caller_id.
/// The offset adjustment is handled as in `replace_abstract_id`.
/// The offset adjustment is handled as in `replace_abstract_id`.
///
///
...
@@ -204,7 +204,7 @@ impl State {
...
@@ -204,7 +204,7 @@ impl State {
caller_id
:
&
AbstractIdentifier
,
caller_id
:
&
AbstractIdentifier
,
offset_adjustment
:
&
BitvectorDomain
,
offset_adjustment
:
&
BitvectorDomain
,
)
{
)
{
self
.memory
.remove_object
_pointer
(
callee_id
);
self
.memory
.remove_object
(
callee_id
);
self
.replace_abstract_id
(
callee_id
,
caller_id
,
offset_adjustment
);
self
.replace_abstract_id
(
callee_id
,
caller_id
,
offset_adjustment
);
}
}
...
...
Write
Preview
Markdown
is supported
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