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
3a25050e
Unverified
Commit
3a25050e
authored
Jul 21, 2021
by
Enkelmann
Committed by
GitHub
Jul 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that each block is contained in exactly one subroutine (#204)
parent
531e2bc1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
graph.rs
src/cwe_checker_lib/src/analysis/graph.rs
+4
-5
term.rs
src/cwe_checker_lib/src/intermediate_representation/term.rs
+0
-0
term.rs
src/cwe_checker_lib/src/pcode/term.rs
+4
-0
No files found.
src/cwe_checker_lib/src/analysis/graph.rs
View file @
3a25050e
...
...
@@ -284,9 +284,8 @@ impl<'a> GraphBuilder<'a> {
Node
::
BlkEnd
(
source_block
,
_
)
=>
source_block
,
_
=>
panic!
(),
};
for
target_address
in
source_block
.term.indirect_jmp_targets
.iter
()
{
let
target_tid
=
Tid
::
blk_id_at_address
(
target_address
);
self
.add_intraprocedural_edge
(
source
,
&
target_tid
,
jump
,
untaken_conditional
);
for
target_tid
in
source_block
.term.indirect_jmp_targets
.iter
()
{
self
.add_intraprocedural_edge
(
source
,
target_tid
,
jump
,
untaken_conditional
);
}
}
...
...
@@ -604,11 +603,11 @@ mod tests {
let
mut
blk_tid
=
Tid
::
new
(
"blk_00001000"
);
blk_tid
.address
=
"00001000"
.to_string
();
let
blk_term
=
Term
{
tid
:
blk_tid
,
tid
:
blk_tid
.clone
()
,
term
:
Blk
{
defs
:
Vec
::
new
(),
jmps
:
vec!
[
indirect_jmp_term
],
indirect_jmp_targets
:
vec!
[
"00001000"
.to_string
()
],
indirect_jmp_targets
:
vec!
[
blk_tid
],
},
};
let
sub_term
=
Term
{
...
...
src/cwe_checker_lib/src/intermediate_representation/term.rs
View file @
3a25050e
This diff is collapsed.
Click to expand it.
src/cwe_checker_lib/src/pcode/term.rs
View file @
3a25050e
...
...
@@ -218,6 +218,10 @@ impl Blk {
term
:
jmp_term
.term
.into
(),
})
.collect
();
let
indirect_jmp_targets
=
indirect_jmp_targets
.into_iter
()
.map
(|
address
|
Tid
::
blk_id_at_address
(
&
address
))
.collect
();
IrBlk
{
defs
,
jmps
,
...
...
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