diff --git a/cargo_klee_examples/examples/array.rs b/cargo_klee_examples/examples/array.rs index 0c6608fd746589a90268321bd0cd590637a44c42..2ea0c720686cf1da712c6c621fd395bbaaec8d4c 100644 --- a/cargo_klee_examples/examples/array.rs +++ b/cargo_klee_examples/examples/array.rs @@ -61,6 +61,13 @@ Running the test case in gdb will show yhou this in the asm code (shown code is │ 0x555555555145 <array::main+37> pop %rax │ │ 0x555555555146 <array::main+38> ret │ │ 0x555555555147 <array::main+39> call 0x555555555150 <_ZN4core9panicking18panic_bounds_check17he935ba9af86f066bE> + +As to why llvm didn't optimize out the variable and its corresponding function call completely I can only guess. +But a good one might be that due to the fact that llvm otimizes on a basis that the a code section is "inconsequential code" we can defere that the code has meaning, +atleast to llvm, and that optimzing it out would change the functionalty of the program (and also what it effects). + +One guess on what that effect might be is that llvm has picked up on that our code can generate an overflow error, which in-turn generates a interrupt in the cpu. +Getting rid of this would change what the program actually does and is there not allowed to be removed. */ // // B) Fix the code so that you don't get an error.