Skip to content

Commit

Permalink
update website
Browse files Browse the repository at this point in the history
Summary:
- 4 new issue types
- odoc 2.4 causes some churn but I guess we have to update at some point
  anyway

Reviewed By: geralt-encore

Differential Revision: D57917791

fbshipit-source-id: c187eb6027bb61d97171f421becf28db44d65dda
  • Loading branch information
jvillard authored and facebook-github-bot committed May 31, 2024
1 parent d90f0fa commit b42f216
Show file tree
Hide file tree
Showing 2,008 changed files with 7,514 additions and 6,224 deletions.
106 changes: 106 additions & 0 deletions website/docs/all-issue-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,25 @@ we assume that any captured weak pointer whose name contains "self" is a weak re
In contrast, `strongSelf` is a local variable to the block, so the check supports any name given to
a local strong pointer that has been assigned `weakSelf`.

## MUTUAL_RECURSION_CYCLE

Reported as "Mutual Recursion Cycle" by [pulse](/docs/next/checker-pulse).

A recursive call or mutually recursive call has been detected. This does *not* mean that the program won't terminate, just that the code is recursive. You should double-check if the recursion is intended and if it can lead to non-termination or a stack overflow.

Example of recursive function:


```C
int factorial(int x) {
if (x > 0) {
return x * factorial(x-1);
} else {
return 1;
}
}
```
## NIL_BLOCK_CALL
Reported as "Nil Block Call" by [pulse](/docs/next/checker-pulse).
Expand Down Expand Up @@ -1770,6 +1789,48 @@ An example of such variadic methods is
In this example, if `str` is `nil` then an array `@[@"aaa"]` of size 1 will be
created, and not an array `@[@"aaa", str, @"bbb"]` of size 3 as expected.

## PULSE_CANNOT_INSTANTIATE_ABSTRACT_CLASS

Reported as "Cannot Instantiate Abstract Class" by [pulse](/docs/next/checker-pulse).

Instantiating an abstract class will lead to `Cannot instantiate abstract class` error.

```hack
abstract class AbstractClass1 {}
class ConcreteClass1 extends AbstractClass1 {}
public static function makeGeneric<T>(classname<T> $cls): void {
new $cls();
}
<<__ConsistentConstruct>>
abstract class AbstractClass2 {
public static function makeStatic(): void {
new static();
}
}
class ConcreteClass2 extends AbstractClass2 {}
public function badViaGeneric(): void {
Main::makeGeneric(AbstractClass1::class); // ERROR!
}
public function goodViaGeneric(): void {
Main::makeGeneric(ConcreteClass1::class);
}
public function badViaStatic(): void {
AbstractClass2::makeStatic(); // ERROR!
}
public function goodViaStatic(): void {
ConcreteClass2::makeStatic();
}
```

## PULSE_CONST_REFABLE

Reported as "Const Refable Parameter" by [pulse](/docs/next/checker-pulse).
Expand Down Expand Up @@ -1806,6 +1867,16 @@ function simple_bad() : int {
}
```

## PULSE_DYNAMIC_TYPE_MISMATCH

Reported as "Dynamic Type Mismatch" by [pulse](/docs/next/checker-pulse).

This error is reported in Hack. It fires when we detect an operation that is incompatible
with the dynamic type of its arguments.

For example, reading `$x['key']` when `$x` is a vector.


## PULSE_READONLY_SHARED_PTR_PARAM

Reported as "Read-only Shared Parameter" by [pulse](/docs/next/checker-pulse).
Expand Down Expand Up @@ -2486,6 +2557,41 @@ hierarchy:
@end
```

## RETAIN_CYCLE_NO_WEAK_INFO

Reported as "Retain Cycle No Weak Info" by [pulse](/docs/next/checker-pulse).

A retain cycle is a situation when object A retains object B, and object B
retains object A at the same time. Here is an example:

```objectivec
@class Child;
@interface Parent : NSObject {
Child *child; // Instance variables are implicitly __strong
}
@end
@interface Child : NSObject {
Parent *parent;
}
@end
```

You can fix a retain cycle in ARC by using \_\_weak variables or weak properties
for your "back links", i.e. links to direct or indirect parents in an object
hierarchy:

```objectivec
@class Child;
@interface Parent : NSObject {
Child *child;
}
@end
@interface Child : NSObject {
__weak Parent *parent;
}
@end
```

## SCOPE_LEAKAGE

Reported as "Scope Leakage" by [scope-leakage](/docs/next/checker-scope-leakage).
Expand Down
4 changes: 4 additions & 0 deletions website/docs/checker-pulse.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ The following issue types are reported by this checker:
- [DATA_FLOW_TO_SINK](/docs/next/all-issue-types#data_flow_to_sink)
- [MEMORY_LEAK_C](/docs/next/all-issue-types#memory_leak_c)
- [MEMORY_LEAK_CPP](/docs/next/all-issue-types#memory_leak_cpp)
- [MUTUAL_RECURSION_CYCLE](/docs/next/all-issue-types#mutual_recursion_cycle)
- [NIL_BLOCK_CALL](/docs/next/all-issue-types#nil_block_call)
- [NIL_BLOCK_CALL_LATENT](/docs/next/all-issue-types#nil_block_call_latent)
- [NIL_INSERTION_INTO_COLLECTION](/docs/next/all-issue-types#nil_insertion_into_collection)
Expand All @@ -175,8 +176,10 @@ The following issue types are reported by this checker:
- [NULL_ARGUMENT_LATENT](/docs/next/all-issue-types#null_argument_latent)
- [OPTIONAL_EMPTY_ACCESS](/docs/next/all-issue-types#optional_empty_access)
- [OPTIONAL_EMPTY_ACCESS_LATENT](/docs/next/all-issue-types#optional_empty_access_latent)
- [PULSE_CANNOT_INSTANTIATE_ABSTRACT_CLASS](/docs/next/all-issue-types#pulse_cannot_instantiate_abstract_class)
- [PULSE_CONST_REFABLE](/docs/next/all-issue-types#pulse_const_refable)
- [PULSE_DICT_MISSING_KEY](/docs/next/all-issue-types#pulse_dict_missing_key)
- [PULSE_DYNAMIC_TYPE_MISMATCH](/docs/next/all-issue-types#pulse_dynamic_type_mismatch)
- [PULSE_READONLY_SHARED_PTR_PARAM](/docs/next/all-issue-types#pulse_readonly_shared_ptr_param)
- [PULSE_REFERENCE_STABILITY](/docs/next/all-issue-types#pulse_reference_stability)
- [PULSE_RESOURCE_LEAK](/docs/next/all-issue-types#pulse_resource_leak)
Expand All @@ -195,6 +198,7 @@ The following issue types are reported by this checker:
- [PULSE_UNNECESSARY_COPY_OPTIONAL_CONST](/docs/next/all-issue-types#pulse_unnecessary_copy_optional_const)
- [PULSE_UNNECESSARY_COPY_RETURN](/docs/next/all-issue-types#pulse_unnecessary_copy_return)
- [RETAIN_CYCLE](/docs/next/all-issue-types#retain_cycle)
- [RETAIN_CYCLE_NO_WEAK_INFO](/docs/next/all-issue-types#retain_cycle_no_weak_info)
- [SENSITIVE_DATA_FLOW](/docs/next/all-issue-types#sensitive_data_flow)
- [STACK_VARIABLE_ADDRESS_ESCAPE](/docs/next/all-issue-types#stack_variable_address_escape)
- [TAINT_ERROR](/docs/next/all-issue-types#taint_error)
Expand Down
72 changes: 54 additions & 18 deletions website/static/man/next/infer-analyze.1.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 17 additions & 8 deletions website/static/man/next/infer-capture.1.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions website/static/man/next/infer-compile.1.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b42f216

Please sign in to comment.