Skip to content
Snippets Groups Projects
Commit 24cea04d authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[kernel] filecheck checks coherence of types in assignments

parent dc74109d
No related branches found
No related tags found
No related merge requests found
...@@ -1310,6 +1310,15 @@ module Base_checker = struct ...@@ -1310,6 +1310,15 @@ module Base_checker = struct
| Local_init (v, ConsInit(f,args,k),loc) -> | Local_init (v, ConsInit(f,args,k),loc) ->
self#check_initialized_var v; self#check_initialized_var v;
Cil.treat_constructor_as_func treat_call v f args k loc Cil.treat_constructor_as_func treat_call v f args k loc
| Set(lv, rv, _) ->
let t1 = Cil.typeOfLval lv in
let t2 = Cil.typeOf rv in
if not (is_admissible_conversion rv t2 t1) then
check_abort
"Incompatible types in assignment %a:\
location has type %a, value has type %a"
Printer.pp_instr i Printer.pp_typ t1 Printer.pp_typ t2;
Cil.DoChildren
| Asm(_,_,Some { asm_gotos },_) -> | Asm(_,_,Some { asm_gotos },_) ->
List.iter self#check_label asm_gotos; Cil.DoChildren List.iter self#check_label asm_gotos; Cil.DoChildren
| _ -> Cil.DoChildren | _ -> Cil.DoChildren
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment