Skip to content

Commit be1899c

Browse files
committed
CHC: update for new Goblint-Cil int/float variants
1 parent bec455a commit be1899c

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

CodeHawk/CHC/cchanalyze/cCHCfgTranslator.ml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,17 +446,17 @@ object (self)
446446
method private translate_basic_block_cmd (instr:instr) context:c_cmd_t =
447447
let ops = ops_provider#get_c_cmd_operations context in
448448
match instr with
449-
| Set (lhs,rhs,loc) ->
449+
| Set (lhs, rhs, loc) ->
450450
begin
451451
env#set_current_location loc;
452452
make_c_cmd_block
453-
(ops @ (assignment_translator#translate context loc lhs rhs ))
453+
(ops @ (assignment_translator#translate context loc lhs rhs))
454454
end
455455
| Call (ret, f, args, loc) ->
456456
begin
457457
env#set_current_location loc;
458458
make_c_cmd_block
459-
(ops @ (call_translator#translate context loc ret f args ))
459+
(ops @ (call_translator#translate context loc ret f args))
460460
end
461461
| Asm (_, templates, asmoutputs, asminputs, _, loc) ->
462462
let asmcode = String.concat ";" (List.map cd#get_string templates) in
@@ -484,6 +484,16 @@ object (self)
484484
env#set_current_location loc;
485485
make_c_cmd_block (ops @ [op] @ asmoutputs @ asminputs)
486486
end
487+
| VarDecl (vinfo, loc) ->
488+
let op =
489+
make_c_cmd
490+
(OPERATION
491+
{op_name = new symbol_t ("VLA: " ^ vinfo.vname); op_args = []}) in
492+
begin
493+
env#set_current_location loc;
494+
make_c_cmd_block (ops @ [op])
495+
end
496+
487497

488498
end
489499

CodeHawk/CHC/cchpre/cCHPrimaryProofObligations.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,12 @@ and create_po_instr env (context:program_context_int) (i:instr) =
13061306
List.iter (fun (_, _, exp) ->
13071307
create_po_exp ~deref:true env context#add_rhs exp loc) asminputs;
13081308
end
1309+
| VarDecl (vinfo, _) ->
1310+
chlog#add
1311+
"instruction primary proof obligation"
1312+
(LBLOCK [
1313+
STR "No suppoert yet for VLA (variable length arrays: ";
1314+
STR vinfo.vname])
13091315

13101316
(* require valid lower and upper bound for global variables that are pointers,
13111317
so these properties can be assumed when these variables are used; idem for

0 commit comments

Comments
 (0)