You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.2 KiB
43 lines
1.2 KiB
6 years ago
|
(*
|
||
6 years ago
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
6 years ago
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*)
|
||
|
|
||
|
(** Issue reporting *)
|
||
|
|
||
|
let unknown_call call =
|
||
|
[%Trace.kprintf
|
||
6 years ago
|
Stop.on_unknown_call
|
||
|
"@\n@[<v 2>%a Unknown function call %a@;<1 2>@[%a@]@]@."
|
||
6 years ago
|
(fun fs call -> Loc.pp fs (Llair.Term.loc call))
|
||
|
call
|
||
|
(fun fs (call : Llair.Term.t) ->
|
||
|
match call with
|
||
5 years ago
|
| Call {callee} -> (
|
||
5 years ago
|
match Reg.of_exp callee with
|
||
|
| Some reg -> Reg.pp_demangled fs reg
|
||
5 years ago
|
| None -> Exp.pp fs callee )
|
||
6 years ago
|
| _ -> () )
|
||
|
call Llair.Term.pp call]
|
||
|
|
||
5 years ago
|
let count = ref 0
|
||
|
let invalid_access_count () = !count
|
||
|
|
||
5 years ago
|
let invalid_access fmt_thunk pp access loc =
|
||
5 years ago
|
Int.incr count ;
|
||
6 years ago
|
let rep fs =
|
||
|
Format.fprintf fs "%a Invalid memory access@;<1 2>@[%a@]" Loc.pp
|
||
|
(loc access) pp access
|
||
|
in
|
||
|
Format.printf "@\n@[<v 2>%t@]@." rep ;
|
||
5 years ago
|
[%Trace.printf "@\n@[<v 2>%t@;<1 2>@[{ %t@ }@]@]@." rep fmt_thunk] ;
|
||
6 years ago
|
Stop.on_invalid_access ()
|
||
6 years ago
|
|
||
5 years ago
|
let invalid_access_inst fmt_thunk inst =
|
||
|
invalid_access fmt_thunk Llair.Inst.pp inst Llair.Inst.loc
|
||
6 years ago
|
|
||
5 years ago
|
let invalid_access_term fmt_thunk term =
|
||
|
invalid_access fmt_thunk Llair.Term.pp term Llair.Term.loc
|