[quandary] make passthroughs optional

Reviewed By: mbouaziz

Differential Revision: D5155878

fbshipit-source-id: dedbebe
master
Sam Blackshear 8 years ago committed by Facebook Github Bot
parent 38d3946c71
commit 4ef487928c

@ -1176,6 +1176,11 @@ and only_footprint =
CLOpt.mk_bool ~deprecated:["only_footprint"] ~long:"only-footprint"
"Skip the re-execution phase"
and passthroughs =
CLOpt.mk_bool ~long:"passthroughs" ~default:false
"In error traces, show intermediate steps that propagate data. When false, error traces are \
shorter and show only direct flow via souces/sinks"
and patterns_modeled_expensive =
let long = "modeled-expensive" in
(long,
@ -1834,6 +1839,7 @@ and suggest_nullable = !suggest_nullable
and no_translate_libs = not !headers
and objc_memory_model_on = !objc_memory_model
and only_footprint = !only_footprint
and passthroughs = !passthroughs
and patterns_never_returning_null = match patterns_never_returning_null with (k,r) -> (k,!r)
and patterns_skip_translation = match patterns_skip_translation with (k,r) -> (k,!r)
and patterns_modeled_expensive = match patterns_modeled_expensive with (k,r) -> (k,!r)

@ -121,6 +121,7 @@ val multicore_dir_name : string
val ncpu : int
val nsnotification_center_checker_backend : bool
val os_type : os_type
val passthroughs : bool
val patterns_modeled_expensive : string * Yojson.Basic.json
val patterns_never_returning_null : string * Yojson.Basic.json
val patterns_skip_translation : string * Yojson.Basic.json

@ -373,12 +373,16 @@ module Make (Spec : Spec) = struct
|> Sinks.union caller_trace.sinks in
let passthroughs =
if phys_equal sources caller_trace.sources && phys_equal sinks caller_trace.sinks
if Config.passthroughs
then
(* this callee didn't add any new sources or any news sinks; it's just a passthrough *)
Passthroughs.add (Passthrough.make callee_site) caller_trace.passthroughs
if phys_equal sources caller_trace.sources && phys_equal sinks caller_trace.sinks
then
(* this callee didn't add any new sources or any news sinks; it's just a passthrough *)
Passthroughs.add (Passthrough.make callee_site) caller_trace.passthroughs
else
caller_trace.passthroughs
else
caller_trace.passthroughs in
Passthroughs.empty in
{ sources; sinks; passthroughs; }

@ -130,13 +130,8 @@ let tests =
|> MockTrace.add_sink sink1 in
assert_bool
"Appended trace should contain source and sink"
(MockTrace.equal (MockTrace.append source_trace footprint_trace call_site) expected_trace);
let appended_trace = MockTrace.append source_trace source_trace call_site in
assert_bool
"Appending a trace that doesn't add a new source/sink should add a passthrough"
(MockTrace.Passthroughs.mem
(Passthrough.make call_site) (MockTrace.passthroughs appended_trace)) in
(MockTrace.equal
(MockTrace.append source_trace footprint_trace call_site) expected_trace) in
"append">::append_ in
"trace_domain_suite">:::[get_reports; append]

@ -10,7 +10,7 @@ TESTS_DIR = ../../..
ANALYZER = checkers
# see explanations in cpp/errors/Makefile for the custom isystem
CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c
INFER_OPTIONS = --quandary --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed
INFER_OPTIONS = --quandary --passthroughs --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed
INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(wildcard *.cpp)

@ -8,7 +8,7 @@
TESTS_DIR = ../../..
ANALYZER = checkers
INFER_OPTIONS = --quandary --no-filtering --debug-exceptions
INFER_OPTIONS = --quandary --passthroughs --no-filtering --debug-exceptions
INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(wildcard *.java)

Loading…
Cancel
Save