Open epatrizio opened 8 months ago
@filipeom, is this expected ?
@filipeom (I guess you missed this one the last time as there was a bunch of different pings haha)
Yes, this is the expected the result. The issue here is probably because Owi raises a Types.Trap "integer overflow"
whereas smtml raises a IntegerOverflow
exception. So they are not being handled correctly by the interpreter.
I can try to re-raise the correct Trap to fix these
Oh, so it should be easy to fix then.
I can try to re-raise the correct Trap to fix these
What do you mean by this?
I was thinking of doing something similar to this:
Because the primitives for concrete interpreter trunc_f{32|64}_{s|u}
raise the trap:
https://github.com/OCamlPro/owi/blob/aef0bd62b3dd028023a63547928f686c3438c3e5/src/primitives/convert.ml#L22
And, in smtml we raise:
https://github.com/formalsec/smtml/blob/a21054602aa9900a2f07d489dba9a313df833b8a/src/eval.ml#L767
I could just change the symbolic trunc_f{32|64}_{s|u}
to do:
let trunc_f32_s x =
try cvtop ty TruncSF32 x with
| IntegerOverflow -> Types.Trap "integer overflow"
To make the behaviour the same as the concrete interpreter
But you don't have access to this exception, right?
symbolic_value: I32 and I64 modules