Skip to content

Commit

Permalink
Merge branch 'master' into term
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-schwarz committed Oct 12, 2023
2 parents 7ba0fd3 + 75b3883 commit 8be0343
Show file tree
Hide file tree
Showing 139 changed files with 646 additions and 297 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
run: npm install -g ajv-cli

- name: Migrate schema # https://github.com/ajv-validator/ajv-cli/issues/199
run: ajv migrate -s src/util/options.schema.json
run: ajv migrate -s src/common/util/options.schema.json

- name: Validate conf
run: ajv validate -s src/util/options.schema.json -d "conf/**/*.json"
run: ajv validate -s src/common/util/options.schema.json -d "conf/**/*.json"

- name: Validate incremental tests
run: ajv validate -s src/util/options.schema.json -d "tests/incremental/*/*.json"
run: ajv validate -s src/common/util/options.schema.json -d "tests/incremental/*/*.json"
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ build:
- pip install json-schema-for-humans
post_build:
- mkdir _readthedocs/html/jsfh/
- generate-schema-doc --config-file jsfh.yml src/util/options.schema.json _readthedocs/html/jsfh/
- generate-schema-doc --config-file jsfh.yml src/common/util/options.schema.json _readthedocs/html/jsfh/
2 changes: 1 addition & 1 deletion docs/user-guide/configuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ In `.vscode/settings.json` add the following:
"/conf/*.json",
"/tests/incremental/*/*.json"
],
"url": "/src/util/options.schema.json"
"url": "/src/common/util/options.schema.json"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion goblint.opam
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ dev-repo: "git+https://github.com/goblint/analyzer.git"
# also remember to generate/adjust goblint.opam.locked!
available: os-distribution != "alpine" & arch != "arm64"
pin-depends: [
[ "goblint-cil.2.0.2" "git+https://github.com/goblint/cil.git#398dca3d94a06a9026b3737aabf100ee3498229f" ]
[ "goblint-cil.2.0.2" "git+https://github.com/goblint/cil.git#c7ffc37ad83216a84d90fdbf427cc02a68ea5331" ]
# TODO: add back after release, only pinned for optimization (https://github.com/ocaml-ppx/ppx_deriving/pull/252)
[ "ppx_deriving.5.2.1" "git+https://github.com/ocaml-ppx/ppx_deriving.git#0a89b619f94cbbfc3b0fb3255ab4fe5bc77d32d6" ]
]
Expand Down
2 changes: 1 addition & 1 deletion goblint.opam.locked
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ post-messages: [
pin-depends: [
[
"goblint-cil.2.0.2"
"git+https://github.com/goblint/cil.git#398dca3d94a06a9026b3737aabf100ee3498229f"
"git+https://github.com/goblint/cil.git#c7ffc37ad83216a84d90fdbf427cc02a68ea5331"
]
[
"ppx_deriving.5.2.1"
Expand Down
2 changes: 1 addition & 1 deletion goblint.opam.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# also remember to generate/adjust goblint.opam.locked!
available: os-distribution != "alpine" & arch != "arm64"
pin-depends: [
[ "goblint-cil.2.0.2" "git+https://github.com/goblint/cil.git#398dca3d94a06a9026b3737aabf100ee3498229f" ]
[ "goblint-cil.2.0.2" "git+https://github.com/goblint/cil.git#c7ffc37ad83216a84d90fdbf427cc02a68ea5331" ]
# TODO: add back after release, only pinned for optimization (https://github.com/ocaml-ppx/ppx_deriving/pull/252)
[ "ppx_deriving.5.2.1" "git+https://github.com/ocaml-ppx/ppx_deriving.git#0a89b619f94cbbfc3b0fb3255ab4fe5bc77d32d6" ]
]
Expand Down
2 changes: 1 addition & 1 deletion gobview
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ nav:
- 👶 Your first analysis: developer-guide/firstanalysis.md
- 🏫 Extending library: developer-guide/extending-library.md
- 📢 Messaging: developer-guide/messaging.md
- 🗃️ API reference: https://goblint.github.io/analyzer/
- 🗃️ API reference: https://goblint.github.io/analyzer/goblint/
- 🚨 Testing: developer-guide/testing.md
- 🪲 Debugging: developer-guide/debugging.md
- 📉 Profiling: developer-guide/profiling.md
Expand Down
3 changes: 2 additions & 1 deletion src/analyses/base.ml
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,8 @@ struct
(match str with Some x -> M.tracel "casto" "CInt (%s, %a, %s)\n" (Z.to_string num) d_ikind ikind x | None -> ());
Int (ID.cast_to ikind (IntDomain.of_const (num,ikind,str)))
| Const (CReal (_,fkind, Some str)) when not (Cilfacade.isComplexFKind fkind) -> Float (FD.of_string fkind str) (* prefer parsing from string due to higher precision *)
| Const (CReal (num, fkind, None)) when not (Cilfacade.isComplexFKind fkind) -> Float (FD.of_const fkind num)
| Const (CReal (num, fkind, None)) when not (Cilfacade.isComplexFKind fkind) && num = 0.0 -> Float (FD.of_const fkind num) (* constant 0 is ok, CIL creates these for zero-initializers; it is safe across float types *)
| Const (CReal (_, fkind, None)) when not (Cilfacade.isComplexFKind fkind) -> assert false (* Cil does not create other CReal without string representation *)
(* String literals *)
| Const (CStr (x,_)) -> Address (AD.of_string x) (* normal 8-bit strings, type: char* *)
| Const (CWStr (xs,_) as c) -> (* wide character strings, type: wchar_t* *)
Expand Down
6 changes: 3 additions & 3 deletions src/analyses/baseInvariant.ml
Original file line number Diff line number Diff line change
Expand Up @@ -805,15 +805,15 @@ struct
| BinOp ((Lt | Gt | Le | Ge | Eq | Ne | LAnd | LOr), _, _, _) -> true
| _ -> false
in
try
let ik = Cilfacade.get_ikind_exp exp in
match Cilfacade.get_ikind_exp exp with
| ik ->
let itv = if not tv || is_cmp exp then (* false is 0, but true can be anything that is not 0, except for comparisons which yield 1 *)
ID.of_bool ik tv (* this will give 1 for true which is only ok for comparisons *)
else
ID.of_excl_list ik [BI.zero] (* Lvals, Casts, arithmetic operations etc. should work with true = non_zero *)
in
inv_exp (Int itv) exp st
with Invalid_argument _ ->
| exception Invalid_argument _ ->
let fk = Cilfacade.get_fkind_exp exp in
let ftv = if not tv then (* false is 0, but true can be anything that is not 0, except for comparisons which yield 1 *)
FD.of_const fk 0.
Expand Down
5 changes: 5 additions & 0 deletions src/analyses/libraryDesc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ type special =
| Broadcast of Cil.exp
| MutexAttrSetType of { attr:Cil.exp; typ: Cil.exp; }
| MutexInit of { mutex:Cil.exp; attr: Cil.exp; }
(* All Sem specials are not used yet. *)
| SemInit of { sem: Cil.exp; pshared: Cil.exp; value: Cil.exp; }
| SemWait of { sem: Cil.exp; try_:bool; timeout: Cil.exp option;}
| SemPost of Cil.exp
| SemDestroy of Cil.exp
| Wait of { cond: Cil.exp; mutex: Cil.exp; }
| TimedWait of { cond: Cil.exp; mutex: Cil.exp; abstime: Cil.exp; (** Unused *) }
| Math of { fun_args: math; }
Expand Down
Loading

0 comments on commit 8be0343

Please sign in to comment.