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
32aad93c
Unverified
Commit
32aad93c
authored
Mar 25, 2022
by
Enkelmann
Committed by
GitHub
Mar 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix crash on division of bitvectors longer than 8 bytes (#308)
parent
d1d04f32
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
bitvector.rs
..._checker_lib/src/intermediate_representation/bitvector.rs
+16
-2
No files found.
src/cwe_checker_lib/src/intermediate_representation/bitvector.rs
View file @
32aad93c
...
...
@@ -173,8 +173,22 @@ impl BitvectorExtended for Bitvector {
Ok
(
self
.clone
()
.into_checked_sdiv
(
rhs
)
?
)
}
}
IntRem
=>
Ok
(
self
.clone
()
.into_checked_urem
(
rhs
)
?
),
IntSRem
=>
Ok
(
self
.clone
()
.into_checked_srem
(
rhs
)
?
),
IntRem
=>
{
// FIXME: Division for bitvectors larger than 8 bytes is not yet implemented in the `apint` crate (version 0.2).
if
self
.width
()
.to_usize
()
>
64
{
Err
(
anyhow!
(
"Multiplication and division of integers larger than 8 bytes not yet implemented."
))
}
else
{
Ok
(
self
.clone
()
.into_checked_urem
(
rhs
)
?
)
}
}
IntSRem
=>
{
// FIXME: Division for bitvectors larger than 8 bytes is not yet implemented in the `apint` crate (version 0.2).
if
self
.width
()
.to_usize
()
>
64
{
Err
(
anyhow!
(
"Multiplication and division of integers larger than 8 bytes not yet implemented."
))
}
else
{
Ok
(
self
.clone
()
.into_checked_srem
(
rhs
)
?
)
}
}
IntLeft
=>
{
let
shift_amount
=
rhs
.try_to_u64
()
.unwrap
()
as
usize
;
if
shift_amount
<
self
.width
()
.to_usize
()
{
...
...
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