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
53193734
Commit
53193734
authored
Sep 25, 2020
by
Enkelmann
Committed by
Enkelmann
Nov 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cargo fmt
parent
c1e142eb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
6 deletions
+34
-6
term.rs
cwe_checker_rs/src/pcode/term.rs
+34
-6
No files found.
cwe_checker_rs/src/pcode/term.rs
View file @
53193734
...
@@ -204,7 +204,6 @@ impl Blk {
...
@@ -204,7 +204,6 @@ impl Blk {
fn
add_load_defs_for_implicit_ram_access
(
&
mut
self
)
{
fn
add_load_defs_for_implicit_ram_access
(
&
mut
self
)
{
let
mut
refactored_defs
=
Vec
::
new
();
let
mut
refactored_defs
=
Vec
::
new
();
for
def
in
self
.defs
.iter
()
{
for
def
in
self
.defs
.iter
()
{
let
mut
cleaned_def
=
def
.clone
();
let
mut
cleaned_def
=
def
.clone
();
if
let
Some
(
input
)
=
&
def
.term.rhs.input0
{
if
let
Some
(
input
)
=
&
def
.term.rhs.input0
{
if
input
.address
.is_some
()
{
if
input
.address
.is_some
()
{
...
@@ -673,8 +672,13 @@ mod tests {
...
@@ -673,8 +672,13 @@ mod tests {
#[test]
#[test]
fn
add_load_defs_for_implicit_ram_access
()
{
fn
add_load_defs_for_implicit_ram_access
()
{
let
mut
blk
:
Blk
=
Blk
{
defs
:
Vec
::
new
(),
jmps
:
Vec
::
new
()};
let
mut
blk
:
Blk
=
Blk
{
blk
.defs
.push
(
serde_json
::
from_str
(
r
#
"
defs
:
Vec
::
new
(),
jmps
:
Vec
::
new
(),
};
blk
.defs
.push
(
serde_json
::
from_str
(
r
#
"
{
{
"
tid
": {
"
tid
": {
"
id
": "
instr_001053f8_0
",
"
id
": "
instr_001053f8_0
",
...
@@ -702,10 +706,34 @@ mod tests {
...
@@ -702,10 +706,34 @@ mod tests {
}
}
}
}
}
}
"
#
)
.unwrap
());
"
#
,
)
.unwrap
(),
);
blk
.add_load_defs_for_implicit_ram_access
();
blk
.add_load_defs_for_implicit_ram_access
();
assert_eq!
(
blk
.defs
[
0
]
.term.lhs
.as_ref
()
.unwrap
()
.name
.as_ref
()
.unwrap
(),
"$load_temp0"
);
assert_eq!
(
assert_eq!
(
blk
.defs
[
1
]
.term.rhs.input0
.as_ref
()
.unwrap
()
.name
.as_ref
()
.unwrap
(),
"$load_temp0"
);
blk
.defs
[
0
]
.term
.lhs
.as_ref
()
.unwrap
()
.name
.as_ref
()
.unwrap
(),
"$load_temp0"
);
assert_eq!
(
blk
.defs
[
1
]
.term
.rhs
.input0
.as_ref
()
.unwrap
()
.name
.as_ref
()
.unwrap
(),
"$load_temp0"
);
assert_eq!
(
blk
.defs
.len
(),
2
);
assert_eq!
(
blk
.defs
.len
(),
2
);
}
}
}
}
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