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

Bitfield Domain #1623

Draft
wants to merge 57 commits into
base: master
Choose a base branch
from
Draft

Bitfield Domain #1623

wants to merge 57 commits into from

Conversation

ManuelLerchner
Copy link

This pull request introduces a new bitfield domain, into the IntDomain.

Currently being worked on...

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semgrep OSS found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

let bf = ref (bot ()) in
while Z.leq !current max_ik do
bf := BArith.join !bf (BArith.of_int (Ints_t.of_bigint !current));
current := Z.add !current Z.one

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.z-add-one Warning

use Z.succ instead
((z3, o3),{underflow=false; overflow=false})

let neg ?no_ov ik x =
M.trace "bitfield" "neg";

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.trace-not-in-tracing Warning

trace functions should only be called if tracing is enabled at compile time
src/cdomain/value/cdomains/intDomain.ml Fixed Show fixed Hide fixed
let refine_with_excl_list ik t (excl : (int_t list * (int64 * int64)) option) : t = t

let invariant_ikind e ik =
M.trace "bitfield" "invariant_ikind";

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.trace-not-in-tracing Warning

trace functions should only be called if tracing is enabled at compile time
| _ -> norm ik bf |> fst

let refine_with_interval ik bf (int: (int_t * int_t) option) : t =
M.trace "bitfield" "refine_with_interval";

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.trace-not-in-tracing Warning

trace functions should only be called if tracing is enabled at compile time
norm ik bf |> fst

let refine_with_excl_list ik bf (excl : (int_t list * (int64 * int64)) option) : t =
M.trace "bitfield" "refine_with_excl_list";

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.trace-not-in-tracing Warning

trace functions should only be called if tracing is enabled at compile time
let lognot ik i1 = BArith.lognot i1

let shift_right ik a b =
M.trace "bitfield" "shift_right";

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.trace-not-in-tracing Warning

trace functions should only be called if tracing is enabled at compile time
norm ik @@ (BArith.shift_right ik a b |> Option.value ~default: (bot ()))

let shift_left ik a b =
M.trace "bitfield" "shift_left";

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.trace-not-in-tracing Warning

trace functions should only be called if tracing is enabled at compile time
else (top_of ik,{underflow=false; overflow=false})

let rem ik x y =
M.trace "bitfield" "rem";

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.trace-not-in-tracing Warning

trace functions should only be called if tracing is enabled at compile time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants