Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
klee
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
Per Lindgren
klee
Commits
7731181b
Commit
7731181b
authored
6 years ago
by
Per
Browse files
Options
Downloads
Patches
Plain Diff
mux examples
parent
761d84be
Branches
beta
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
klee-examples/examples/cc_lab4_contract.rs
+22
-17
22 additions, 17 deletions
klee-examples/examples/cc_lab4_contract.rs
klee-examples/examples/path1.rs
+3
-9
3 additions, 9 deletions
klee-examples/examples/path1.rs
src/lib.rs
+10
-4
10 additions, 4 deletions
src/lib.rs
with
35 additions
and
30 deletions
klee-examples/examples/cc_lab4_contract.rs
+
22
−
17
View file @
7731181b
...
...
@@ -10,23 +10,28 @@ static mut PLAIN: [u8; 132] = [0; 132];
static
ABC
:
[
u32
;
4
]
=
[
0x9fdd9158
,
0x85715808
,
0xac73323a
,
0
];
static
CODED
:
[
u32
;
132
]
=
[
0x015e7a47
,
0x2ef84ebb
,
0x177a8db4
,
0x1b722ff9
,
0x5dc7cff0
,
0x5dc9dea6
,
0x1da0c15a
,
0xe4c236a2
,
0x3d16b0d0
,
0x1f397842
,
0xaae0d2ba
,
0x11246674
,
0x0845317f
,
0xd5512dad
,
0xb6184977
,
0xd293a53e
,
0x7d9c2716
,
0xd917eae6
,
0xd8852384
,
0x286e46f9
,
0xce566029
,
0xcefe7daf
,
0x62d726d4
,
0x0dbaeb2d
,
0x95f57c60
,
0xed515141
,
0x29b77d0f
,
0x9f7b8d0c
,
0x45a8395a
,
0xfead2b72
,
0x883d434c
,
0xed8ddf60
,
0xe51e65e4
,
0x19bf6bb1
,
0xfeb505ec
,
0x662aa23c
,
0xf6827cf8
,
0xd1dc7a5c
,
0x4fa5b066
,
0x7ddd25a4
,
0xa8ba8e8a
,
0x72846227
,
0xf8f636fb
,
0x2b389a9c
,
0xe4038bf6
,
0x6e169877
,
0xad028132
,
0x84dbfe8c
,
0x243762ff
,
0x59c8f80c
,
0xb6e0db4b
,
0xedb8cab7
,
0xcd4b39f6
,
0xaf263741
,
0x18d9965f
,
0x1ab1f037
,
0x5b458792
,
0xc94d960d
,
0xd45cedea
,
0x2160aca3
,
0x93c77766
,
0x2d66e105
,
0x9ff74d4f
,
0x6dc22f21
,
0x6b03d689
,
0x5fc48de0
,
0x1138f000
,
0xccb58e57
,
0xf9c8e200
,
0x7ab26e3c
,
0xc61dcb3e
,
0x6aefccb0
,
0x7a452f05
,
0xa5cf0731
,
0xa249383f
,
0x628fe534
,
0xcad81710
,
0x7f616276
,
0x3ce18308
,
0xed4857ff
,
0xd1e5b1d1
,
0xc2e84dc2
,
0xaa003742
,
0xaf637488
,
0x831afc48
,
0x287a69a0
,
0x6e04546e
,
0x13dffa07
,
0x3232fb10
,
0xd69e2e09
,
0x355d8dc7
,
0xef902301
,
0x9a89ac15
,
0x967dc900
,
0x08dc2b1c
,
0x6b5be690
,
0x894b0e02
,
0xe26af9af
,
0xa6fd3b23
,
0xfcf213e5
,
0x85217608
,
0x7fd3be8b
,
0xa2e757fb
,
0x3717a341
,
0x85ee426d
,
0x394bb856
,
0x12ac98c3
,
0xec7d4ab5
,
0x721b6989
,
0x30e36360
,
0xaa018403
,
0x9ee61196
,
0xa8697adc
,
0x51e9d65a
,
0x11023594
,
0xc4c4b36b
,
0xda80bf7a
,
0xbd5a645e
,
0x18cea918
,
0xa723dda8
,
0x0126c05e
,
0x2962d48a
,
0xd5f7d312
,
0xb8947041
,
0x7c1e2e9a
,
0x945eeac3
,
0x7110fb1c
,
0xa7bc72cc
,
0xdf47dfbb
,
0x09a1c6c8
,
0xc2e41061
,
0
,
0x015e7a47
,
0x2ef84ebb
,
0x177a8db4
,
0x1b722ff9
,
0x5dc7cff0
,
0x5dc9dea6
,
0x1da0c15a
,
0xe4c236a2
,
0x3d16b0d0
,
0x1f397842
,
0xaae0d2ba
,
0x11246674
,
0x0845317f
,
0xd5512dad
,
0xb6184977
,
0xd293a53e
,
0x7d9c2716
,
0xd917eae6
,
0xd8852384
,
0x286e46f9
,
0xce566029
,
0xcefe7daf
,
0x62d726d4
,
0x0dbaeb2d
,
0x95f57c60
,
0xed515141
,
0x29b77d0f
,
0x9f7b8d0c
,
0x45a8395a
,
0xfead2b72
,
0x883d434c
,
0xed8ddf60
,
0xe51e65e4
,
0x19bf6bb1
,
0xfeb505ec
,
0x662aa23c
,
0xf6827cf8
,
0xd1dc7a5c
,
0x4fa5b066
,
0x7ddd25a4
,
0xa8ba8e8a
,
0x72846227
,
0xf8f636fb
,
0x2b389a9c
,
0xe4038bf6
,
0x6e169877
,
0xad028132
,
0x84dbfe8c
,
0x243762ff
,
0x59c8f80c
,
0xb6e0db4b
,
0xedb8cab7
,
0xcd4b39f6
,
0xaf263741
,
0x18d9965f
,
0x1ab1f037
,
0x5b458792
,
0xc94d960d
,
0xd45cedea
,
0x2160aca3
,
0x93c77766
,
0x2d66e105
,
0x9ff74d4f
,
0x6dc22f21
,
0x6b03d689
,
0x5fc48de0
,
0x1138f000
,
0xccb58e57
,
0xf9c8e200
,
0x7ab26e3c
,
0xc61dcb3e
,
0x6aefccb0
,
0x7a452f05
,
0xa5cf0731
,
0xa249383f
,
0x628fe534
,
0xcad81710
,
0x7f616276
,
0x3ce18308
,
0xed4857ff
,
0xd1e5b1d1
,
0xc2e84dc2
,
0xaa003742
,
0xaf637488
,
0x831afc48
,
0x287a69a0
,
0x6e04546e
,
0x13dffa07
,
0x3232fb10
,
0xd69e2e09
,
0x355d8dc7
,
0xef902301
,
0x9a89ac15
,
0x967dc900
,
0x08dc2b1c
,
0x6b5be690
,
0x894b0e02
,
0xe26af9af
,
0xa6fd3b23
,
0xfcf213e5
,
0x85217608
,
0x7fd3be8b
,
0xa2e757fb
,
0x3717a341
,
0x85ee426d
,
0x394bb856
,
0x12ac98c3
,
0xec7d4ab5
,
0x721b6989
,
0x30e36360
,
0xaa018403
,
0x9ee61196
,
0xa8697adc
,
0x51e9d65a
,
0x11023594
,
0xc4c4b36b
,
0xda80bf7a
,
0xbd5a645e
,
0x18cea918
,
0xa723dda8
,
0x0126c05e
,
0x2962d48a
,
0xd5f7d312
,
0xb8947041
,
0x7c1e2e9a
,
0x945eeac3
,
0x7110fb1c
,
0xa7bc72cc
,
0xdf47dfbb
,
0x09a1c6c8
,
0xc2e41061
,
0
,
];
//# FUNCTION codgen(): UNSIGNED INTEGER;
...
...
This diff is collapsed.
Click to expand it.
klee-examples/examples/path1.rs
+
3
−
9
View file @
7731181b
...
...
@@ -14,17 +14,11 @@ fn add(a:u32, b:u32) -> u32 {
#[no_mangle]
fn
main
()
{
let
mut
a
:
[
u32
;
5
]
=
unsafe
{
core
::
mem
::
uninitialized
()
};
// let mut b : [u32; 5] = unsafe { core::mem::uninitialized()};
ksymbol!
(
&
mut
a
,
"a"
);
// ksymbol!(&mut b, "b");
for
(
i
,
a
)
in
a
.iter_mut
()
.enumerate
()
{
if
*
a
>
0
{
*
a
=
a
.wrapping_add
(
1
);
// += 1; // add(*a, 1);
// klee::abort();
*
a
=
a
.wrapping_add
(
1
);
}
}
// unsafe {
// ptr::read_volatile(&b);
// }
}
This diff is collapsed.
Click to expand it.
src/lib.rs
+
10
−
4
View file @
7731181b
...
...
@@ -6,7 +6,8 @@
extern
crate
cstr_core
;
mod
lang_items
;
mod
ll
;
pub
mod
ll
;
pub
mod
mutex
;
use
core
::
mem
;
...
...
@@ -20,6 +21,7 @@ pub fn abort() -> ! {
unsafe
{
ll
::
abort
()
}
}
#[inline(always)]
pub
fn
kassume
(
cond
:
bool
)
{
unsafe
{
ll
::
klee_assume
(
cond
);
...
...
@@ -54,12 +56,16 @@ pub fn kmksymbol<T>(t: &mut T, name: &CStr) {
macro_rules!
ksymbol
{
(
$name:expr
)
=>
{
$crate
::
ksymbol
(
unsafe
{
$crate
::
CStr
::
from_bytes_with_nul_unchecked
(
concat!
(
$name
,
"
\0
"
)
.as_bytes
())
$crate
::
CStr
::
from_bytes_with_nul_unchecked
(
concat!
(
$name
,
"
\0
"
)
.as_bytes
(),
)
})
};
(
&
mut
$id:expr
,
$name:expr
)
=>
{
$crate
::
kmksymbol
(
unsafe
{
&
mut
$id
},
unsafe
{
$crate
::
CStr
::
from_bytes_with_nul_unchecked
(
concat!
(
$name
,
"
\0
"
)
.as_bytes
())
$crate
::
CStr
::
from_bytes_with_nul_unchecked
(
concat!
(
$name
,
"
\0
"
)
.as_bytes
(),
)
})
};
}
...
...
@@ -68,7 +74,7 @@ macro_rules! ksymbol {
macro_rules!
kassert
{
(
$e:expr
)
=>
{
if
!
$e
{
$crate
::
abort
()
;
unsafe
{
$crate
::
ll
::
abort
()
}
}
};
}
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