Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enables writing program semantics (lifting) in Primus Lisp #1277

Merged
merged 1 commit into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions lib/bap_core_theory/bap_core_theory_target.ml
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,17 @@ let declare
t

let lookup ?package name =
let name = Self.read ?package name in
if Hashtbl.mem targets name then Some name
else None
try Some (Self.read ?package name)
with _exn -> None

let get ?package name =
let name = Self.read ?package name in
if not (Hashtbl.mem targets name)
then invalid_argf "Unknown target %s" (Self.to_string name) ();
name
match lookup ?package name with
| None ->
invalid_argf
"Unknown target %s. \
Use `bap list targets' for the list of targets"
name ();
| Some t -> t

let read = get

Expand Down
Loading