Skip to content

Commit

Permalink
[CIAC] Adjust error message and get rid of hack prefix while printing…
Browse files Browse the repository at this point in the history
… a type

Summary: Adjust error message and get rid of hack prefix while printing a type

Reviewed By: skcho

Differential Revision:
D57489024

Privacy Context Container: L1122176

fbshipit-source-id: bc6c289e179a29427231f067227f31d154a6d904
  • Loading branch information
geralt-encore authored and facebook-github-bot committed May 20, 2024
1 parent 86f07c2 commit fea27ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion infer/src/pulse/PulseDiagnostic.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ let get_trace = function
| HackCannotInstantiateAbstractClass {type_name; calling_context; location} ->
get_trace_calling_context calling_context
@@ [ Errlog.make_trace_element 0 location
(F.asprintf "%a initialized here" Typ.Name.pp type_name)
(F.asprintf "abstract class %s initialized here" (Typ.Name.name type_name))
[] ]
| HackUnawaitedAwaitable {location; allocation_trace} ->
(* NOTE: this is very similar to the MemoryLeak case *)
Expand Down
4 changes: 2 additions & 2 deletions infer/tests/codetoanalyze/hack/pulse/issues.exp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ call_variadic.hack, CallVariadic::CallVariadic$static.transitiveCallVariadicWith
call_variadic.hack, CallVariadic::CallVariadic$static.transitiveCallVariadicWith3ArgsBisBad, 1, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `$root.Level1::taintSource` with kind `Simple`,when calling `Variadic::Variadic$static.callVariadic` here,when calling `Variadic::Variadic$static.variadicArgInSink` here,flows to this sink: value passed as argument `#0` to `$root.Level1::taintSink` with kind `Simple`], source: $root.Level1::taintSource, sink: $root.Level1::taintSink, tainted expression: $root.Level1::taintSource()
call_variadic.hack, CallVariadic::CallVariadic$static.callVariadicArg0InSinkBad, 1, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `$root.Level1::taintSource` with kind `Simple`,when calling `Variadic::Variadic$static.variadicArg0InSink` here,flows to this sink: value passed as argument `#0` to `$root.Level1::taintSink` with kind `Simple`], source: $root.Level1::taintSource, sink: $root.Level1::taintSink, tainted expression: $root.Level1::taintSource()
call_variadic.hack, CallVariadic::CallVariadic$static.FP_callVariadicArg0InSinkOk, 1, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `$root.Level1::taintSource` with kind `Simple`,when calling `Variadic::Variadic$static.variadicArg0InSink` here,flows to this sink: value passed as argument `#0` to `$root.Level1::taintSink` with kind `Simple`], source: $root.Level1::taintSource, sink: $root.Level1::taintSink, tainted expression: $root.Level1::taintSource()
cannot_instantiate_abstract_class.hack, CannotInstantiateAbstractClassTests::Tests.initAbstractClassViaGenericFunBad, 2, PULSE_CANNOT_INSTANTIATE_ABSTRACT_CLASS, no_bucket, ERROR, [calling context starts here,in call to `CannotInstantiateAbstractClassTests::Main$static.makeGeneric`,hack CannotInstantiateAbstractClassTests::AbstractClass1 initialized here]
cannot_instantiate_abstract_class.hack, CannotInstantiateAbstractClassTests::Tests.initAbstractClassViaStaticBad, 2, PULSE_CANNOT_INSTANTIATE_ABSTRACT_CLASS, no_bucket, ERROR, [calling context starts here,in call to `CannotInstantiateAbstractClassTests::AbstractClass2$static.makeStatic`,hack CannotInstantiateAbstractClassTests::AbstractClass2 initialized here]
cannot_instantiate_abstract_class.hack, CannotInstantiateAbstractClassTests::Tests.initAbstractClassViaGenericFunBad, 2, PULSE_CANNOT_INSTANTIATE_ABSTRACT_CLASS, no_bucket, ERROR, [calling context starts here,in call to `CannotInstantiateAbstractClassTests::Main$static.makeGeneric`,abstract class CannotInstantiateAbstractClassTests::AbstractClass1 initialized here]
cannot_instantiate_abstract_class.hack, CannotInstantiateAbstractClassTests::Tests.initAbstractClassViaStaticBad, 2, PULSE_CANNOT_INSTANTIATE_ABSTRACT_CLASS, no_bucket, ERROR, [calling context starts here,in call to `CannotInstantiateAbstractClassTests::AbstractClass2$static.makeStatic`,abstract class CannotInstantiateAbstractClassTests::AbstractClass2 initialized here]
closure_in_closure.hack, ClosureInClosure::Main$static.bad1, 1, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `$root.Level1::taintSource` with kind `Simple`,when calling `ClosureInClosure::Utils$static.compute` here,when calling `ClosureInClosure::Utils$static.run1` here,when calling `Closure$ClosureInClosure::Utils::compute232.__invoke` here,when calling `ClosureInClosure::Utils$static.run2` here,when calling `Closure$ClosureInClosure::Utils::compute.__invoke` here,when calling `ClosureInClosure::B.process` here,flows to this sink: value passed as argument `#0` to `$root.Level1::taintSink` with kind `Simple`], source: $root.Level1::taintSource, sink: $root.Level1::taintSink, tainted expression: $root.Level1::taintSource()
closure_in_closure.hack, ClosureInClosure::Main$static.bad2, 1, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `$root.Level1::taintSource` with kind `Simple`,when calling `ClosureInClosure::Utils$static.compute` here,when calling `ClosureInClosure::Utils$static.run1` here,when calling `Closure$ClosureInClosure::Utils::compute232.__invoke` here,when calling `ClosureInClosure::Utils$static.run2` here,when calling `Closure$ClosureInClosure::Utils::compute.__invoke` here,when calling `ClosureInClosure::B.process` here,flows to this sink: value passed as argument `#0` to `$root.Level1::taintSink` with kind `Simple`], source: $root.Level1::taintSource, sink: $root.Level1::taintSink, tainted expression: $root.Level1::taintSource()
closure_in_closure.hack, ClosureInClosure::Main$static.bad3, 1, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `$root.Level1::taintSource` with kind `Simple`,when calling `ClosureInClosure::Utils$static.compute` here,when calling `ClosureInClosure::Utils$static.run1` here,when calling `Closure$ClosureInClosure::Utils::compute232.__invoke` here,when calling `ClosureInClosure::Utils$static.run2` here,when calling `Closure$ClosureInClosure::Utils::compute.__invoke` here,when calling `ClosureInClosure::B.process` here,flows to this sink: value passed as argument `#0` to `$root.Level1::taintSink` with kind `Simple`], source: $root.Level1::taintSource, sink: $root.Level1::taintSink, tainted expression: $root.Level1::taintSource()
Expand Down

0 comments on commit fea27ab

Please sign in to comment.