Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
klee_tutorial
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Ruben Asplund
klee_tutorial
Commits
4efe9bc1
Commit
4efe9bc1
authored
4 years ago
by
Ruben Asplund
Browse files
Options
Downloads
Patches
Plain Diff
Exercise A
parent
43ee88ae
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cargo_klee_examples/examples/array.rs
+5
-1
5 additions, 1 deletion
cargo_klee_examples/examples/array.rs
with
5 additions
and
1 deletion
cargo_klee_examples/examples/array.rs
+
5
−
1
View file @
4efe9bc1
...
@@ -37,7 +37,11 @@ fn main() {
...
@@ -37,7 +37,11 @@ fn main() {
// Try to explain in your own words the difference and why?
// Try to explain in your own words the difference and why?
// (Hint, even if we don't use the result `b`, Rust do not optimize out the call, why?)
// (Hint, even if we don't use the result `b`, Rust do not optimize out the call, why?)
//
//
// [your answer here]
// [There are 10 path with debug/dev mode and 2 path on release mode.
// In the debug mode/dev 8 of the paths is 8 for each loop, 1 path is for panic when index is out of range.
// The release mode is optimizing out all the loops, which means there are only two paths; one inside the loop
// and one outside. The b is not optimized out because the calculation of b can have side effects and
// code with side effects are not optimized out.]
//
//
// B) Fix the code so that you don't get an error.
// B) Fix the code so that you don't get an error.
// (It should still compute the sum of the n first elements
// (It should still compute the sum of the n first elements
...
...
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