Skip to content

Commit 5df7a36

Browse files
authored
Merge pull request #1982 from goblint/refine-pointer-by-pointee-option
Add option `ana.base.branch.refine-pointer-by-pointee`
2 parents 3b9ed98 + 1104f8c commit 5df7a36

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

conf/examples/large-program.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"privatization": "none",
88
"context": {
99
"non-ptr": false
10+
},
11+
"branch": {
12+
"refine-pointer-by-pointee": false
1013
}
1114
},
1215
"thread": {

src/analyses/baseInvariant.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct
112112
if M.tracing then M.tracel "inv" "st from %a to %a" D.pretty st D.pretty r;
113113
r
114114
)
115-
| Mem (Lval lv), off ->
115+
| Mem (Lval lv), off when GobConfig.get_bool "ana.base.branch.refine-pointer-by-pointee" ->
116116
(* Underlying lvals (may have offsets themselves), e.g., for struct members NOT including any offset appended to outer Mem *)
117117
let lvals = eval_lv ~man st (Mem (Lval lv), NoOffset) in
118118
(* Additional offset of value being refined in Addr Offset type *)

src/config/options.schema.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,19 @@
886886
}
887887
},
888888
"additionalProperties": false
889+
},
890+
"branch": {
891+
"title": "ana.base.branch",
892+
"type": "object",
893+
"properties": {
894+
"refine-pointer-by-pointee": {
895+
"title": "ana.base.branch.refine-pointer-by-pointee",
896+
"description": "Refine points-to sets by dereferenced value when branching.",
897+
"type": "boolean",
898+
"default": true
899+
}
900+
},
901+
"additionalProperties": false
889902
}
890903
},
891904
"additionalProperties": false

0 commit comments

Comments
 (0)