Commit a96f9dc5 authored by Frédéric Recoules's avatar Frédéric Recoules
Browse files

Fix issues

- replace 'which' by 'command' (#13)
- fix compilation with latest 'menhir' version (#14)
parent c5e8cdce
......@@ -21,7 +21,7 @@
default: binsec
ifneq (, $(shell which opam 2> /dev/null))
ifneq (, $(shell command -v opam 2> /dev/null))
define install_deps
$(shell dune external-lib-deps --missing $(1) 2>&1 \
......@@ -46,7 +46,7 @@ switch:
endif
ifeq (, $(shell which dune 2> /dev/null))
ifeq (, $(shell command -v dune 2> /dev/null))
define check_dune
$(error "Please install dune or run 'make switch'.")
......@@ -60,7 +60,7 @@ endef
endif
ifneq (, $(shell which ocamlformat 2> /dev/null))
ifneq (, $(shell command -v ocamlformat 2> /dev/null))
define apply_ocamlformat
$(shell dune build @fmt --auto-promote)
......
......@@ -62,11 +62,7 @@ depends: [
"qcheck" {with-test & >= "0.7"}
"odoc" {with-doc}
]
depopts: [
"llvm"
"unisim_archisec"
"bitwuzla"
]
depopts: ["llvm" "unisim_archisec" "bitwuzla"]
conflicts: [
"llvm" {< "6.0.0"}
"llvm" {>= "13.0.0"}
......@@ -87,4 +83,4 @@ build: [
]
]
dev-repo: "git+https://github.com/binsec/binsec.git"
available: [ arch = "x86_64" | arch = "ppc64" | arch = "arm64" | arch = "sparc64" ]
available: [ arch = "x86_64" | arch = "ppc64" | arch = "arm64" | arch = "sparc64" ]
\ No newline at end of file
......@@ -320,7 +320,7 @@ module AddressStack = struct
Dba_printer.Ascii.pp_code_address caddr Call_stack.pp call_stack n
end
type 'a dbainstrmap = (Dba.Instr.t * 'a option) Caddress.Map.t
type dbainstrmap = Dba.Instr.t Caddress.Map.t
module Declarations = struct
type t = (Dba.size * Dba.VarTag.t) Basic_types.String.Map.t
......@@ -518,10 +518,10 @@ type exec_perm = Exec of bool
type permissions = Dba.Expr.t * (read_perm * write_perm * exec_perm)
type 'a program = {
type program = {
start_address : Dba.address;
declarations : Declarations.t;
permissions : permissions list Region.Map.t * Dba.Expr.t Rights.t;
initializations : Dba.Instr.t list;
instructions : 'a dbainstrmap;
instructions : dbainstrmap;
}
......@@ -254,7 +254,7 @@ end
val malloc_id : int ref
type 'a dbainstrmap = (Dba.Instr.t * 'a option) Caddress.Map.t
type dbainstrmap = Dba.Instr.t Caddress.Map.t
type read_perm = Read of bool
......@@ -264,10 +264,10 @@ type exec_perm = Exec of bool
type permissions = Dba.Expr.t * (read_perm * write_perm * exec_perm)
type 'a program = {
type program = {
start_address : Dba.address;
declarations : Declarations.t;
permissions : permissions list Region.Map.t * Dba.Expr.t Rights.t;
initializations : Dba.Instr.t list;
instructions : 'a dbainstrmap;
instructions : dbainstrmap;
}
......@@ -176,7 +176,7 @@ module Mk = struct
let instructions =
List.fold_left
(fun map (address, instruction) ->
Dba_types.Caddress.Map.add address (instruction, None) map)
Dba_types.Caddress.Map.add address instruction map)
Dba_types.Caddress.Map.empty instructions
in
let initializations =
......
......@@ -97,7 +97,7 @@ module Mk : sig
Dba.address ->
Dba.LValue.t list ->
(Dba_types.Caddress.Map.key * Dba.Instr.t) list ->
'a Dba_types.program
Dba_types.program
module Predicates : sig
val of_list :
......
......@@ -33,7 +33,7 @@ val read_string :
parser:('a -> Lexing.lexbuf -> 'b) -> lexer:'a -> string:string -> 'b
(** parses the content of a string with nice error messages *)
val read_dba_file : string -> 'a Dba_types.program
val read_dba_file : string -> Dba_types.program
val read_optional_config_file : string option -> Infos.t
(** [read_optional_config_file optfile] parses [optfile] if it is not [None].
......
......@@ -82,7 +82,7 @@
%type <Dba.Expr.t> expr_eof
%start dba
%type <'a Dba_types.program> dba
%type <Dba_types.program> dba
%start dhunk_eof
%type <Dhunk.t> dhunk_eof
......
......@@ -321,12 +321,12 @@ module Image = struct
end
module Dba_program = struct
type t = Dba.id Dba_types.program
type t = Dba_types.program
exception Ox8BADF00D of Dba.address
let fetch t c =
try Caddr.Map.find c t.Dba_types.instructions |> fst
try Caddr.Map.find c t.Dba_types.instructions
with Not_found -> raise @@ Ox8BADF00D c
end
......
......@@ -59,7 +59,7 @@ end
module Image : Program with type t = unit
module Dba_program : Program with type t = Dba.id Dba_types.program
module Dba_program : Program with type t = Dba_types.program
module Instr_list : sig
include Program
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment