Skip to content
Open
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
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ DIRECT_TESTS += \
c_performance \
c_pulse \
c_pulse-over-only \
c_pulse-over-only-balanced \
c_pulse-over-under \
c_purity \
c_export-textual \
Expand Down
3 changes: 2 additions & 1 deletion infer/src/absint/AbstractInterpreter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,8 @@ struct
(((post, non_disj_astates) as post_astate), dropped, n_disjuncts, extra)
pre_disjunct
->
if n_disjuncts >= global_limit && not (use_balanced_disjunct_strategy ()) then (
(* the balanced strategy below gives a disjunct a [limit] of 0 exactly when this holds *)
if n_disjuncts >= global_limit then (
L.d_printfln "@[<v2>Reached max disjuncts limit, skipping disjunct #%d@;@]" i ;
(post_astate, pre_disjunct :: dropped, n_disjuncts, 0) )
else
Expand Down
4 changes: 2 additions & 2 deletions infer/tests/build_systems/disjunctive_domain/disjunctive.exp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ loop:
#2: two_branch0.0.two_branch1.0
#3: two_branch0.0.two_branch1.1
Non-disjunctive state: ⊥
CFG Metadata: dropped_disjuncts= 5; interrupted_loops= 0
CFG Metadata: dropped_disjuncts= 7; interrupted_loops= 0


No issues found
Expand Down Expand Up @@ -283,7 +283,7 @@ loop:
#8: two_branch0.0.two_branch1.1.two_branch4.0
#9: two_branch0.0.two_branch1.1.two_branch4.1
Non-disjunctive state: ⊥
CFG Metadata: dropped_disjuncts= 6; interrupted_loops= 1
CFG Metadata: dropped_disjuncts= 10; interrupted_loops= 1


No issues found
23 changes: 23 additions & 0 deletions infer/tests/codetoanalyze/c/pulse-over-only-balanced/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

TESTS_DIR = ../../..

# The tests of ../pulse-over-only with the balanced disjunct strategy, which must give the same
# results since no disjunct is kept

CLANG_OPTIONS = -c
INFER_OPTIONS = \
--pulse-only --debug-exceptions --project-root $(TESTS_DIR) \
--pulse-report-issues-for-tests --no-pulse-force-continue \
--pulse-max-disjuncts 0 --pulse-over-approximate-reasoning \
--pulse-balanced-disjuncts-strategy \
--pulse-transitive-access-config ../pulse-over-only/transitive-access.conf \

INFERPRINT_OPTIONS = --issues-tests

SOURCES = $(wildcard ../pulse-over-only/*.c)

include $(TESTS_DIR)/clang.make
10 changes: 10 additions & 0 deletions infer/tests/codetoanalyze/c/pulse-over-only-balanced/issues.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
codetoanalyze/c/pulse-over-only/attributes.c, init_one_branch_only_bad, 5, PULSE_UNINITIALIZED_VALUE, no_bucket, ERROR, [variable `x` declared here,read to uninitialized value occurs here]
codetoanalyze/c/pulse-over-only/attributes.c, FNsuppressed_invalid_one_branch_only_bad, 6, NULLPTR_DEREFERENCE, no_bucket, ERROR, [*** SUPPRESSED ***,source of the null value part of the trace starts here,assigned,is assigned to the null pointer,null pointer dereference part of the trace starts here,invalid access occurs here]
codetoanalyze/c/pulse-over-only/attributes.c, interproc_joined_invalid_deref_bad, 2, NULLPTR_DEREFERENCE, no_bucket, ERROR, [*** SUPPRESSED ***,source of the null value part of the trace starts here,when calling `get_maybe_invalid_pointer` here,assigned,is assigned to the null pointer,null pointer dereference part of the trace starts here,in call to `get_maybe_invalid_pointer`,assigned,when calling `maybe_deref_pointer` here,parameter `p` of maybe_deref_pointer,invalid access occurs here]
codetoanalyze/c/pulse-over-only/attributes.c, FP_interproc_path_sensitive_valid_deref_ok, 2, NULLPTR_DEREFERENCE, no_bucket, ERROR, [*** SUPPRESSED ***,source of the null value part of the trace starts here,when calling `get_maybe_invalid_pointer` here,assigned,is assigned to the null pointer,null pointer dereference part of the trace starts here,in call to `get_maybe_invalid_pointer`,assigned,when calling `maybe_deref_pointer` here,parameter `p` of maybe_deref_pointer,invalid access occurs here]
codetoanalyze/c/pulse-over-only/formula.c, FP_same_facts_different_branches_ok, 19, NULLPTR_DEREFERENCE, no_bucket, ERROR, [is assigned to the null pointer,assigned,invalid access occurs here]
codetoanalyze/c/pulse-over-only/formula.c, FP_same_facts_different_branches_ok, 23, NULLPTR_DEREFERENCE, no_bucket, ERROR, [is assigned to the null pointer,assigned,invalid access occurs here]
codetoanalyze/c/pulse-over-only/join.c, join_valid_invalid_pointers, 1, NULLPTR_DEREFERENCE_LATENT, no_bucket, ERROR, [*** SUPPRESSED ***,source of the null value part of the trace starts here,is assigned to the null pointer,null pointer dereference part of the trace starts here,parameter `p` of join_valid_invalid_pointers,invalid access occurs here]
codetoanalyze/c/pulse-over-only/join.c, continue_after_fatal_bad2, 8, NULLPTR_DEREFERENCE, no_bucket, ERROR, [*** SUPPRESSED ***,source of the null value part of the trace starts here,assigned,is assigned to the null pointer,null pointer dereference part of the trace starts here,invalid access occurs here]
codetoanalyze/c/pulse-over-only/join.c, continue_after_fatal_bad2, 10, NULLPTR_DEREFERENCE, no_bucket, ERROR, [is assigned to the null pointer,assigned,invalid access occurs here]
codetoanalyze/c/pulse-over-only/transitive-access.c, source_bad, 0, PULSE_TRANSITIVE_ACCESS, no_bucket, ERROR, [when calling `wrapper_ok` here,access occurs here]
Loading