Skip to content

Commit

Permalink
allows the arm-set-encoding to provide conflicting information (Binar…
Browse files Browse the repository at this point in the history
…yAnalysisPlatform#1382)

Since several patterns may match the same byte sequence, we will
accept only the first match and ignore the rest.
  • Loading branch information
ivg authored Dec 7, 2021
1 parent dceac1e commit b694d30
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/arm/arm_target.ml
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ module Encodings = struct
KB.Domain.mapping (module Bitvec_order) "encodings"
~equal:CT.Language.equal


let set_encoding label x y =
let* addr = x.?[Sigma.static] in
let* code = y.?[Sigma.symbol] in
Expand All @@ -519,8 +520,10 @@ module Encodings = struct
| other ->
Sigma.failp "unknown encoding %s, expects :T32 or :A32" other in
let* encodings = unit-->slot in
KB.provide slot unit @@ Map.set encodings addr lang >>| fun () ->
Sigma.Effect.pure Sigma.Value.nil
let res = Map.set encodings addr lang in
KB.catch (KB.provide slot unit res) (fun _ -> KB.return ()) >>|
fun () -> Sigma.Effect.pure Sigma.Value.nil


let provide_primitive () =
let types = Lambda.Type.Spec.(tuple [int; sym] @-> sym) in
Expand Down

0 comments on commit b694d30

Please sign in to comment.