Skip to content
Snippets Groups Projects
Commit 27797ebf authored by Per's avatar Per
Browse files

simply chaos

parent 28b88b09
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ extern crate cstr_core; ...@@ -7,7 +7,7 @@ extern crate cstr_core;
extern crate cty; extern crate cty;
// mod lang_items; // mod lang_items;
pub mod ll; mod ll;
use core::mem; use core::mem;
...@@ -42,7 +42,7 @@ pub fn k_mk_symbol<T>(t: &mut T, name: &CStr) { ...@@ -42,7 +42,7 @@ pub fn k_mk_symbol<T>(t: &mut T, name: &CStr) {
} }
} }
#[inline(always)] #[inline(never)]
pub fn k_abort() -> ! { pub fn k_abort() -> ! {
unsafe { unsafe {
ll::abort(); ll::abort();
...@@ -50,7 +50,7 @@ pub fn k_abort() -> ! { ...@@ -50,7 +50,7 @@ pub fn k_abort() -> ! {
} }
/// assume a condition involving symbolic variables /// assume a condition involving symbolic variables
#[inline(always)] #[inline(never)]
pub fn k_assume(cond: bool) { pub fn k_assume(cond: bool) {
unsafe { unsafe {
ll::klee_assume(cond); ll::klee_assume(cond);
...@@ -58,12 +58,10 @@ pub fn k_assume(cond: bool) { ...@@ -58,12 +58,10 @@ pub fn k_assume(cond: bool) {
} }
/// assert a condition involving symbolic variables /// assert a condition involving symbolic variables
#[inline(always)] #[inline(never)]
pub fn k_assert(e: bool) { pub fn k_assert(e: bool) {
if !e { if !e {
unsafe { k_abort();
ll::abort();
}
} }
} }
...@@ -82,21 +80,6 @@ macro_rules! k_symbol { ...@@ -82,21 +80,6 @@ macro_rules! k_symbol {
} }
} }
/// assertion
#[macro_export]
macro_rules! k_assert {
($e: expr) => {
{
use klee::ll;
if !$e {
unsafe {
ll::abort();
}
}
}
}
}
#[macro_export] #[macro_export]
macro_rules! k_visit { macro_rules! k_visit {
()=> { ()=> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment