Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
seer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nils Fitinghoff
seer
Commits
148e6475
Commit
148e6475
authored
7 years ago
by
nilfit
Browse files
Options
Downloads
Patches
Plain Diff
change + to wrapping_add
This gets the tests to pass again. Without this, execution stops at an overflow.
parent
3b4c362e
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/symbolic/manticore.rs
+9
-9
9 additions, 9 deletions
tests/symbolic/manticore.rs
tests/symbolic/ptr_offset.rs
+1
-1
1 addition, 1 deletion
tests/symbolic/ptr_offset.rs
tests/symbolic/write_mem.rs
+4
-4
4 additions, 4 deletions
tests/symbolic/write_mem.rs
with
14 additions
and
14 deletions
tests/symbolic/manticore.rs
+
9
−
9
View file @
148e6475
...
@@ -13,7 +13,7 @@ fn check_char_0(mut ch: u8) -> Result<(), ()> {
...
@@ -13,7 +13,7 @@ fn check_char_0(mut ch: u8) -> Result<(), ()> {
fn
check_char_1
(
mut
ch
:
u8
)
->
Result
<
(),
()
>
{
fn
check_char_1
(
mut
ch
:
u8
)
->
Result
<
(),
()
>
{
ch
^=
107
;
ch
^=
107
;
ch
+
=
67
;
ch
=
ch
.wrapping_add
(
67
)
;
if
ch
==
105
{
if
ch
==
105
{
Ok
(())
Ok
(())
...
@@ -23,7 +23,7 @@ fn check_char_1(mut ch: u8) -> Result<(), ()> {
...
@@ -23,7 +23,7 @@ fn check_char_1(mut ch: u8) -> Result<(), ()> {
}
}
fn
check_char_2
(
mut
ch
:
u8
)
->
Result
<
(),
()
>
{
fn
check_char_2
(
mut
ch
:
u8
)
->
Result
<
(),
()
>
{
ch
+
=
61
;
ch
=
ch
.wrapping_add
(
61
)
;
ch
*=
2
;
ch
*=
2
;
if
ch
==
252
{
if
ch
==
252
{
...
@@ -66,7 +66,7 @@ fn check_char_5(mut ch: u8) -> Result<(), ()> {
...
@@ -66,7 +66,7 @@ fn check_char_5(mut ch: u8) -> Result<(), ()> {
}
}
fn
check_char_6
(
mut
ch
:
u8
)
->
Result
<
(),
()
>
{
fn
check_char_6
(
mut
ch
:
u8
)
->
Result
<
(),
()
>
{
ch
+
=
71
;
ch
=
ch
.wrapping_add
(
71
)
;
if
ch
==
138
{
if
ch
==
138
{
Ok
(())
Ok
(())
...
@@ -86,8 +86,8 @@ fn check_char_7(mut ch: u8) -> Result<(), ()> {
...
@@ -86,8 +86,8 @@ fn check_char_7(mut ch: u8) -> Result<(), ()> {
}
}
fn
check_char_8
(
mut
ch
:
u8
)
->
Result
<
(),
()
>
{
fn
check_char_8
(
mut
ch
:
u8
)
->
Result
<
(),
()
>
{
ch
+
=
41
;
ch
=
ch
.wrapping_add
(
41
)
;
ch
+
=
53
;
ch
=
ch
.wrapping_add
(
53
)
;
if
ch
==
176
{
if
ch
==
176
{
Ok
(())
Ok
(())
...
@@ -98,8 +98,8 @@ fn check_char_8(mut ch: u8) -> Result<(), ()> {
...
@@ -98,8 +98,8 @@ fn check_char_8(mut ch: u8) -> Result<(), ()> {
fn
check_char_9
(
mut
ch
:
u8
)
->
Result
<
(),
()
>
{
fn
check_char_9
(
mut
ch
:
u8
)
->
Result
<
(),
()
>
{
ch
^=
61
;
ch
^=
61
;
ch
+
=
41
;
ch
=
ch
.wrapping_add
(
41
)
;
ch
+
=
11
;
ch
=
ch
.wrapping_add
(
11
)
;
if
ch
==
172
{
if
ch
==
172
{
Ok
(())
Ok
(())
...
@@ -110,8 +110,8 @@ fn check_char_9(mut ch: u8) -> Result<(), ()> {
...
@@ -110,8 +110,8 @@ fn check_char_9(mut ch: u8) -> Result<(), ()> {
fn
check_char_10
(
mut
ch
:
u8
)
->
Result
<
(),
()
>
{
fn
check_char_10
(
mut
ch
:
u8
)
->
Result
<
(),
()
>
{
ch
^=
47
;
ch
^=
47
;
ch
+
=
29
;
ch
=
ch
.wrapping_add
(
29
)
;
ch
+
=
67
;
ch
=
ch
.wrapping_add
(
67
)
;
if
ch
==
114
{
if
ch
==
114
{
Ok
(())
Ok
(())
...
...
This diff is collapsed.
Click to expand it.
tests/symbolic/ptr_offset.rs
+
1
−
1
View file @
148e6475
...
@@ -11,7 +11,7 @@ fn main() {
...
@@ -11,7 +11,7 @@ fn main() {
let
d0
=
data
[
0
];
// 2
let
d0
=
data
[
0
];
// 2
let
d1
=
data
[
1
];
// 4
let
d1
=
data
[
1
];
// 4
if
(
d0
+
d1
)
as
usize
>=
v
.len
()
{
if
(
d0
.wrapping_add
(
d1
)
)
as
usize
>=
v
.len
()
{
return
;
return
;
}
}
...
...
This diff is collapsed.
Click to expand it.
tests/symbolic/write_mem.rs
+
4
−
4
View file @
148e6475
...
@@ -10,11 +10,11 @@ fn main() {
...
@@ -10,11 +10,11 @@ fn main() {
// should panic on [ 7, 3, 21, 21 ]
// should panic on [ 7, 3, 21, 21 ]
if
data
.len
()
>=
4
{
if
data
.len
()
>=
4
{
let
mut
v
=
[
0
;
BUFFER_LENGTH
];
let
mut
v
:
[
u8
;
BUFFER_LENGTH
]
=
[
0
;
BUFFER_LENGTH
];
v
[
0
]
+
=
data
[
3
];
v
[
0
]
=
v
[
0
]
.wrapping_add
(
data
[
3
]
)
;
v
[
1
]
=
v
[
0
]
+
data
[
2
];
v
[
1
]
=
v
[
0
]
.wrapping_add
(
data
[
2
]
)
;
if
v
[
0
]
==
21
&&
v
[
1
]
==
42
{
if
v
[
0
]
==
21
&&
v
[
1
]
==
42
{
v
[
0
]
=
data
[
0
]
+
data
[
1
];
v
[
0
]
=
data
[
0
]
.wrapping_add
(
data
[
1
]
)
;
v
[
3
]
=
data
[
0
];
v
[
3
]
=
data
[
0
];
if
v
[
3
]
==
7
&&
v
[
0
]
==
10
{
if
v
[
3
]
==
7
&&
v
[
0
]
==
10
{
panic!
()
panic!
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment