[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" CLOpt.mk_bool ~deprecated:["only_footprint"] ~long:"only-footprint"
"Skip the re-execution phase" "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 = and patterns_modeled_expensive =
let long = "modeled-expensive" in let long = "modeled-expensive" in
(long, (long,
@ -1834,6 +1839,7 @@ and suggest_nullable = !suggest_nullable
and no_translate_libs = not !headers and no_translate_libs = not !headers
and objc_memory_model_on = !objc_memory_model and objc_memory_model_on = !objc_memory_model
and only_footprint = !only_footprint 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_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_skip_translation = match patterns_skip_translation with (k,r) -> (k,!r)
and patterns_modeled_expensive = match patterns_modeled_expensive 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 ncpu : int
val nsnotification_center_checker_backend : bool val nsnotification_center_checker_backend : bool
val os_type : os_type val os_type : os_type
val passthroughs : bool
val patterns_modeled_expensive : string * Yojson.Basic.json val patterns_modeled_expensive : string * Yojson.Basic.json
val patterns_never_returning_null : string * Yojson.Basic.json val patterns_never_returning_null : string * Yojson.Basic.json
val patterns_skip_translation : 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 |> Sinks.union caller_trace.sinks in
let passthroughs = let passthroughs =
if Config.passthroughs
then
if phys_equal sources caller_trace.sources && phys_equal sinks caller_trace.sinks if phys_equal sources caller_trace.sources && phys_equal sinks caller_trace.sinks
then then
(* this callee didn't add any new sources or any news sinks; it's just a passthrough *) (* 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 Passthroughs.add (Passthrough.make callee_site) caller_trace.passthroughs
else else
caller_trace.passthroughs in caller_trace.passthroughs
else
Passthroughs.empty in
{ sources; sinks; passthroughs; } { sources; sinks; passthroughs; }

@ -130,13 +130,8 @@ let tests =
|> MockTrace.add_sink sink1 in |> MockTrace.add_sink sink1 in
assert_bool assert_bool
"Appended trace should contain source and sink" "Appended trace should contain source and sink"
(MockTrace.equal (MockTrace.append source_trace footprint_trace call_site) expected_trace); (MockTrace.equal
(MockTrace.append source_trace footprint_trace call_site) expected_trace) in
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
"append">::append_ in "append">::append_ in
"trace_domain_suite">:::[get_reports; append] "trace_domain_suite">:::[get_reports; append]

@ -10,7 +10,7 @@ TESTS_DIR = ../../..
ANALYZER = checkers ANALYZER = checkers
# see explanations in cpp/errors/Makefile for the custom isystem # 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 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 INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(wildcard *.cpp) SOURCES = $(wildcard *.cpp)

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

Loading…
Cancel
Save