Skip to content

Commit b5dc093

Browse files
committed
Merge branch 'master' into thread/join
2 parents 72703a6 + d43ad0e commit b5dc093

File tree

8 files changed

+35
-6
lines changed

8 files changed

+35
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ goblint.bc.js
5050

5151
# Files generated by merge tools after conflicts
5252
*.orig
53+
54+
sv-comp/goblint.zip

src/analyses/base.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ struct
697697
let a1 = eval_rv a gs st e1 in
698698
let a2 = eval_rv a gs st e2 in
699699
let both_arith_type = isArithmeticType (typeOf e1) && isArithmeticType (typeOf e2) in
700-
let is_safe = VD.equal a1 a2 || VD.is_safe_cast t1 (typeOf e1) && VD.is_safe_cast t2 (typeOf e2) && not both_arith_type in
700+
let is_safe = (VD.equal a1 a2 || VD.is_safe_cast t1 (typeOf e1) && VD.is_safe_cast t2 (typeOf e2)) && not both_arith_type in
701701
M.tracel "cast" "remove cast on both sides for %a? -> %b\n" d_exp exp is_safe;
702702
if is_safe then ( (* we can ignore the casts if the values are equal anyway, or if the casts can't change the value *)
703703
let e1 = if isArithmeticType (typeOf e1) then c1 else e1 in
@@ -1870,7 +1870,7 @@ struct
18701870
let start_addr = eval_tv ctx.ask ctx.global ctx.local start in
18711871
List.filter_map (create_thread (Some (Mem id, NoOffset)) (Some ptc_arg)) (AD.to_var_may start_addr)
18721872
end
1873-
| `Unknown _ -> begin
1873+
| `Unknown _ when get_bool "exp.unknown_funs_spawn" -> begin
18741874
let args =
18751875
match LF.get_invalidate_action f.vname with
18761876
| Some fnc -> fnc `Write args (* why do we only spawn arguments that are written?? *)
@@ -1934,7 +1934,7 @@ struct
19341934
let special ctx (lv:lval option) (f: varinfo) (args: exp list) =
19351935
(* let heap_var = heap_var !Tracing.current_loc in*)
19361936
let forks = forkfun ctx lv f args in
1937-
if M.tracing then M.tracel "spawn" "Base.special %s: spawning functions %a\n" f.vname (d_list "," d_varinfo) (List.map BatTuple.Tuple3.second forks);
1937+
if M.tracing then if not (List.is_empty forks) then M.tracel "spawn" "Base.special %s: spawning functions %a\n" f.vname (d_list "," d_varinfo) (List.map BatTuple.Tuple3.second forks);
19381938
List.iter (BatTuple.Tuple3.uncurry ctx.spawn) forks;
19391939
let cpa,dep as st = ctx.local in
19401940
let gs = ctx.global in

src/domains/setDomain.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ struct
614614
let inter = product_bot B.meet
615615
let meet = inter
616616
let subset = leq
617+
let map' = map (* HACK: for PathSensitive morphstate *)
617618
let map f a = map f a |> reduce
618619
let min_elt a = B.bot ()
619620
let split x a = failwith "Hoare: unsupported split"

src/framework/constraints.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ struct
974974

975975
let exitstate v = D.singleton (Spec.exitstate v)
976976
let startstate v = D.singleton (Spec.startstate v)
977-
let morphstate v d = D.map (Spec.morphstate v) d
977+
let morphstate v d = D.map' (Spec.morphstate v) d
978978

979979
let call_descr = Spec.call_descr
980980

src/util/goblintutil.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ let escape (x:string):string =
119119
Str.global_replace (Str.regexp "\"") """ |>
120120
Str.global_replace (Str.regexp "'") "'" |>
121121
Str.global_replace (Str.regexp "\x0b") "" |> (* g2html just cannot handle \v from some kernel benchmarks, even when escaped... *)
122-
Str.global_replace (Str.regexp "\001") "" (* g2html just cannot handle \v from some kernel benchmarks, even when escaped... *)
122+
Str.global_replace (Str.regexp "\001") "" |> (* g2html just cannot handle \v from some kernel benchmarks, even when escaped... *)
123+
Str.global_replace (Str.regexp "\x0c") "" (* g2html just cannot handle \v from some kernel benchmarks, even when escaped... *)
123124

124125
let trim (x:string): string =
125126
let len = String.length x in

src/witness/witnessConstraints.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ struct
8585
let map (f: key -> key) (s: t): t = match s with
8686
| `Top -> `Top
8787
| `Lifted s -> `Lifted (M.fold (fun x v acc -> M.M.add (f x) (R.join v (M.find (f x) acc)) acc) s (M.M.empty))
88+
let map' = map (* HACK: for PathSensitive morphstate *)
89+
(* TODO: reducing map, like HoareSet *)
8890

8991
module S =
9092
struct
@@ -296,7 +298,7 @@ struct
296298

297299
let exitstate v = (Dom.singleton (Spec.exitstate v) (R.bot ()), Sync.bot ())
298300
let startstate v = (Dom.singleton (Spec.startstate v) (R.bot ()), Sync.bot ())
299-
let morphstate v (d, _) = (Dom.map (Spec.morphstate v) d, Sync.bot())
301+
let morphstate v (d, _) = (Dom.map' (Spec.morphstate v) d, Sync.bot ())
300302

301303
let call_descr = Spec.call_descr
302304

sv-comp/archive.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
cd ..
4+
5+
rm goblint/sv-comp/goblint.zip
6+
7+
zip goblint/sv-comp/goblint.zip \
8+
goblint/goblint \
9+
goblint/conf/svcomp21.json \
10+
goblint/includes/sv-comp.c \
11+
goblint/LICENSE
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// PARAM: --set ana.activated ["'base'","'mallocWrapper'"]
2+
static long main(void)
3+
{
4+
unsigned int cmd;
5+
int __cil_tmp12 ;
6+
7+
if ((unsigned int )((int )cmd) == (unsigned int )__cil_tmp12) {
8+
cmd = 17;
9+
}
10+
11+
return 0;
12+
}

0 commit comments

Comments
 (0)