Skip to content
Snippets Groups Projects
Commit 19b1be74 authored by Tristan Le Gall's avatar Tristan Le Gall
Browse files

[alias] fixed - print_dot function

parent 1679e8d6
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,6 @@ let main () = ...@@ -29,6 +29,6 @@ let main () =
Analysis.compute (); Analysis.compute ();
Options.feedback "Analysis complete"; Options.feedback "Analysis complete";
end end
let () = let () =
Db.Main.extend main Db.Main.extend main
...@@ -297,11 +297,10 @@ let remove_lval (x:t) (lv:lval) :t = ...@@ -297,11 +297,10 @@ let remove_lval (x:t) (lv:lval) :t =
let find_vertex_name_ref = Extlib.mk_fun "find_vertex_name" let find_vertex_name_ref = Extlib.mk_fun "find_vertex_name"
let lset_to_string s = let lset_to_string (s: LSet.t) : string =
let buffer = Buffer.create 16 in let fmt = Format.str_formatter in
let fmt = Format.formatter_of_buffer buffer in Format.fprintf fmt "\"%a\"" LSet.pretty s;
Format.fprintf fmt "%a" LSet.pretty s ; Format.flush_str_formatter ()
Buffer.contents buffer
module Dot = Graphviz.Dot(struct module Dot = Graphviz.Dot(struct
include G include G
...@@ -311,7 +310,9 @@ module Dot = Graphviz.Dot(struct ...@@ -311,7 +310,9 @@ module Dot = Graphviz.Dot(struct
let vertex_attributes _ = [`Shape `Box] let vertex_attributes _ = [`Shape `Box]
let vertex_name (v:V.t) = let vertex_name (v:V.t) =
let lset = !find_vertex_name_ref v in let lset = !find_vertex_name_ref v in
lset_to_string lset let v_name = lset_to_string lset in
Format.printf "Vertex %d set %s@." v v_name;
v_name
let default_vertex_attributes _ = [] let default_vertex_attributes _ = []
let graph_attributes _ = [] let graph_attributes _ = []
end) end)
......
...@@ -103,7 +103,7 @@ let do_assignment (a:Abstract_state.t option) (lv:lval) (exp:exp) : Abstract_sta ...@@ -103,7 +103,7 @@ let do_assignment (a:Abstract_state.t option) (lv:lval) (exp:exp) : Abstract_sta
begin begin
match e1.enode with match e1.enode with
Lval lv1 -> Some (Abstract_state.assignment_ptr_x_y a lv1 lv2) Lval lv1 -> Some (Abstract_state.assignment_ptr_x_y a lv1 lv2)
| _ -> (Options.feedback "Skipping assignment @[%a@] = @[%a@] (BUG do_assignment 2)" Lval.pretty lv Exp.pretty exp; Some a) | _ -> (Options.feedback "Skipping assignment @[%a@] = @[%a@] (BUG do_assignment 2)" Lval.pretty lv Exp.pretty exp; Some a)
end end
(* cases *x = cst *) (* cases *x = cst *)
| (Some a, (Mem e1, NoOffset), BNone) -> | (Some a, (Mem e1, NoOffset), BNone) ->
......
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