Skip to content

Commit

Permalink
Fix witness determine_result for memsafety
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Oct 31, 2023
1 parent 3747556 commit 5093b5d
Showing 1 changed file with 61 additions and 3 deletions.
64 changes: 61 additions & 3 deletions src/witness/witness.ml
Original file line number Diff line number Diff line change
Expand Up @@ -505,16 +505,74 @@ struct
in
(module TaskResult:WitnessTaskResult)
)
| ValidFree
| ValidDeref
| ValidFree ->
let module TrivialArg =
struct
include Arg
let next _ = []
end
in
if not !AnalysisState.svcomp_may_invalid_free then (
let module TaskResult =
struct
module Arg = Arg
let result = Result.True
let invariant _ = Invariant.none
let is_violation _ = false
let is_sink _ = false
end
in
(module TaskResult:WitnessTaskResult)
) else (
let module TaskResult =
struct
module Arg = TrivialArg
let result = Result.Unknown
let invariant _ = Invariant.none
let is_violation _ = false
let is_sink _ = false
end
in
(module TaskResult:WitnessTaskResult)
)
| ValidDeref ->
let module TrivialArg =
struct
include Arg
let next _ = []
end
in
if not !AnalysisState.svcomp_may_invalid_deref then (
let module TaskResult =
struct
module Arg = Arg
let result = Result.True
let invariant _ = Invariant.none
let is_violation _ = false
let is_sink _ = false
end
in
(module TaskResult:WitnessTaskResult)
) else (
let module TaskResult =
struct
module Arg = TrivialArg
let result = Result.Unknown
let invariant _ = Invariant.none
let is_violation _ = false
let is_sink _ = false
end
in
(module TaskResult:WitnessTaskResult)
)
| ValidMemtrack ->
let module TrivialArg =
struct
include Arg
let next _ = []
end
in
if not !AnalysisState.svcomp_may_invalid_free && not !AnalysisState.svcomp_may_invalid_deref && not !AnalysisState.svcomp_may_invalid_memtrack then (
if not !AnalysisState.svcomp_may_invalid_memtrack then (
let module TaskResult =
struct
module Arg = Arg
Expand Down

0 comments on commit 5093b5d

Please sign in to comment.