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
a85352c5
Commit
a85352c5
authored
Oct 06, 2020
by
Enkelmann
Committed by
Enkelmann
Nov 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 2 small bugs
parent
e6db1887
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
5 deletions
+9
-5
data.rs
cwe_checker_rs/src/abstract_domain/data.rs
+3
-0
trait_impls.rs
..._rs/src/analysis/pointer_inference/context/trait_impls.rs
+3
-3
mod.rs
cwe_checker_rs/src/intermediate_representation/mod.rs
+2
-1
term.rs
cwe_checker_rs/src/intermediate_representation/term.rs
+1
-1
No files found.
cwe_checker_rs/src/abstract_domain/data.rs
View file @
a85352c5
...
@@ -161,6 +161,9 @@ impl<T: RegisterDomain> RegisterDomain for DataDomain<T> {
...
@@ -161,6 +161,9 @@ impl<T: RegisterDomain> RegisterDomain for DataDomain<T> {
fn
subpiece
(
&
self
,
low_byte
:
ByteSize
,
size
:
ByteSize
)
->
Self
{
fn
subpiece
(
&
self
,
low_byte
:
ByteSize
,
size
:
ByteSize
)
->
Self
{
if
let
Self
::
Value
(
value
)
=
self
{
if
let
Self
::
Value
(
value
)
=
self
{
Self
::
Value
(
value
.subpiece
(
low_byte
,
size
))
Self
::
Value
(
value
.subpiece
(
low_byte
,
size
))
}
else
if
low_byte
==
ByteSize
::
new
(
0
)
&&
size
==
self
.bytesize
()
{
// The operation is a no-op
self
.clone
()
}
else
{
}
else
{
Self
::
new_top
(
size
)
Self
::
new_top
(
size
)
}
}
...
...
cwe_checker_rs/src/analysis/pointer_inference/context/trait_impls.rs
View file @
a85352c5
...
@@ -34,9 +34,9 @@ impl<'a> crate::analysis::interprocedural_fixpoint::Context<'a> for Context<'a>
...
@@ -34,9 +34,9 @@ impl<'a> crate::analysis::interprocedural_fixpoint::Context<'a> for Context<'a>
match
&
def
.term
{
match
&
def
.term
{
Def
::
Store
{
address
,
value
}
=>
{
Def
::
Store
{
address
,
value
}
=>
{
let
mut
state
=
state
.clone
();
let
mut
new_
state
=
state
.clone
();
self
.log_debug
(
state
.handle_store
(
address
,
value
),
Some
(
&
def
.tid
));
self
.log_debug
(
new_
state
.handle_store
(
address
,
value
),
Some
(
&
def
.tid
));
Some
(
state
)
Some
(
new_
state
)
}
}
Def
::
Assign
{
var
,
value
}
=>
{
Def
::
Assign
{
var
,
value
}
=>
{
let
mut
new_state
=
state
.clone
();
let
mut
new_state
=
state
.clone
();
...
...
cwe_checker_rs/src/intermediate_representation/mod.rs
View file @
a85352c5
...
@@ -74,8 +74,9 @@ impl From<ByteSize> for apint::BitWidth {
...
@@ -74,8 +74,9 @@ impl From<ByteSize> for apint::BitWidth {
}
}
impl
From
<
apint
::
BitWidth
>
for
ByteSize
{
impl
From
<
apint
::
BitWidth
>
for
ByteSize
{
/// Convert to `ByteSize`, while always rounding up to the nearest full byte.
fn
from
(
bitwidth
:
apint
::
BitWidth
)
->
ByteSize
{
fn
from
(
bitwidth
:
apint
::
BitWidth
)
->
ByteSize
{
ByteSize
::
new
(
bitwidth
.to_usize
()
as
u64
/
8
)
ByteSize
::
new
(
(
bitwidth
.to_usize
()
+
7
)
as
u64
/
8
)
}
}
}
}
...
...
cwe_checker_rs/src/intermediate_representation/term.rs
View file @
a85352c5
...
@@ -188,7 +188,7 @@ impl ExternSymbol {
...
@@ -188,7 +188,7 @@ impl ExternSymbol {
if
self
.return_values
.len
()
==
1
{
if
self
.return_values
.len
()
==
1
{
match
self
.return_values
[
0
]
{
match
self
.return_values
[
0
]
{
Arg
::
Register
(
ref
var
)
=>
Ok
(
var
),
Arg
::
Register
(
ref
var
)
=>
Ok
(
var
),
Arg
::
Stack
{
..
}
=>
Err
(
anyhow!
(
"Return value is passed on the stak"
)),
Arg
::
Stack
{
..
}
=>
Err
(
anyhow!
(
"Return value is passed on the sta
c
k"
)),
}
}
}
else
{
}
else
{
Err
(
anyhow!
(
"Wrong number of return values"
))
Err
(
anyhow!
(
"Wrong number of return values"
))
...
...
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