Skip to content
Snippets Groups Projects
Commit ff2aff68 authored by Edvin Åkerfeldt's avatar Edvin Åkerfeldt
Browse files

cargo_klee_examples/examples/cyccnt.rs, A & B

parent 564c95bd
No related branches found
No related tags found
No related merge requests found
...@@ -167,6 +167,12 @@ fn main() { ...@@ -167,6 +167,12 @@ fn main() {
// What do you get, and why? // What do you get, and why?
// //
// [your answer here] // [your answer here]
/*
(gdb) print start
$1 = <optimized out>
Because _time is never used, the value has been optimized away. Same for end
*/
// //
// As you should have seen, this was not particularly informative, right? // As you should have seen, this was not particularly informative, right?
// //
...@@ -198,14 +204,26 @@ fn main() { ...@@ -198,14 +204,26 @@ fn main() {
// Value of `start`. // Value of `start`.
// //
// [your answer here] // [your answer here]
/*
(gdb) print start
$1 = 2147483648
*/
// //
// Value of `end` // Value of `end`
// //
// [your answer here] // [your answer here]
/*
(gdb) print end
$2 = 0
*/
// //
// Why does these values cause an error debug/dev build but not in a release build? // Why does these values cause an error debug/dev build but not in a release build?
// //
// [your answer here] // [your answer here]
/*
I think its because the subtraction never takes place in the optimized version.
TODO: Make sure this is the case.
*/
// //
// C) Fix the problem! // C) Fix the problem!
// //
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment