Skip to content

Commit b42f216

Browse files
jvillardfacebook-github-bot
authored andcommitted
update website
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
1 parent d90f0fa commit b42f216

File tree

2,008 files changed

+7514
-6224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,008 files changed

+7514
-6224
lines changed

website/docs/all-issue-types.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,25 @@ we assume that any captured weak pointer whose name contains "self" is a weak re
12431243
In contrast, `strongSelf` is a local variable to the block, so the check supports any name given to
12441244
a local strong pointer that has been assigned `weakSelf`.
12451245

1246+
## MUTUAL_RECURSION_CYCLE
1247+
1248+
Reported as "Mutual Recursion Cycle" by [pulse](/docs/next/checker-pulse).
1249+
1250+
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.
1251+
1252+
Example of recursive function:
1253+
1254+
1255+
```C
1256+
int factorial(int x) {
1257+
if (x > 0) {
1258+
return x * factorial(x-1);
1259+
} else {
1260+
return 1;
1261+
}
1262+
}
1263+
```
1264+
12461265
## NIL_BLOCK_CALL
12471266
12481267
Reported as "Nil Block Call" by [pulse](/docs/next/checker-pulse).
@@ -1770,6 +1789,48 @@ An example of such variadic methods is
17701789
In this example, if `str` is `nil` then an array `@[@"aaa"]` of size 1 will be
17711790
created, and not an array `@[@"aaa", str, @"bbb"]` of size 3 as expected.
17721791

1792+
## PULSE_CANNOT_INSTANTIATE_ABSTRACT_CLASS
1793+
1794+
Reported as "Cannot Instantiate Abstract Class" by [pulse](/docs/next/checker-pulse).
1795+
1796+
Instantiating an abstract class will lead to `Cannot instantiate abstract class` error.
1797+
1798+
```hack
1799+
abstract class AbstractClass1 {}
1800+
1801+
class ConcreteClass1 extends AbstractClass1 {}
1802+
1803+
public static function makeGeneric<T>(classname<T> $cls): void {
1804+
new $cls();
1805+
}
1806+
1807+
<<__ConsistentConstruct>>
1808+
abstract class AbstractClass2 {
1809+
1810+
public static function makeStatic(): void {
1811+
new static();
1812+
}
1813+
}
1814+
1815+
class ConcreteClass2 extends AbstractClass2 {}
1816+
1817+
public function badViaGeneric(): void {
1818+
Main::makeGeneric(AbstractClass1::class); // ERROR!
1819+
}
1820+
1821+
public function goodViaGeneric(): void {
1822+
Main::makeGeneric(ConcreteClass1::class);
1823+
}
1824+
1825+
public function badViaStatic(): void {
1826+
AbstractClass2::makeStatic(); // ERROR!
1827+
}
1828+
1829+
public function goodViaStatic(): void {
1830+
ConcreteClass2::makeStatic();
1831+
}
1832+
```
1833+
17731834
## PULSE_CONST_REFABLE
17741835

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

1870+
## PULSE_DYNAMIC_TYPE_MISMATCH
1871+
1872+
Reported as "Dynamic Type Mismatch" by [pulse](/docs/next/checker-pulse).
1873+
1874+
This error is reported in Hack. It fires when we detect an operation that is incompatible
1875+
with the dynamic type of its arguments.
1876+
1877+
For example, reading `$x['key']` when `$x` is a vector.
1878+
1879+
18091880
## PULSE_READONLY_SHARED_PTR_PARAM
18101881

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

2560+
## RETAIN_CYCLE_NO_WEAK_INFO
2561+
2562+
Reported as "Retain Cycle No Weak Info" by [pulse](/docs/next/checker-pulse).
2563+
2564+
A retain cycle is a situation when object A retains object B, and object B
2565+
retains object A at the same time. Here is an example:
2566+
2567+
```objectivec
2568+
@class Child;
2569+
@interface Parent : NSObject {
2570+
Child *child; // Instance variables are implicitly __strong
2571+
}
2572+
@end
2573+
@interface Child : NSObject {
2574+
Parent *parent;
2575+
}
2576+
@end
2577+
```
2578+
2579+
You can fix a retain cycle in ARC by using \_\_weak variables or weak properties
2580+
for your "back links", i.e. links to direct or indirect parents in an object
2581+
hierarchy:
2582+
2583+
```objectivec
2584+
@class Child;
2585+
@interface Parent : NSObject {
2586+
Child *child;
2587+
}
2588+
@end
2589+
@interface Child : NSObject {
2590+
__weak Parent *parent;
2591+
}
2592+
@end
2593+
```
2594+
24892595
## SCOPE_LEAKAGE
24902596

24912597
Reported as "Scope Leakage" by [scope-leakage](/docs/next/checker-scope-leakage).

website/docs/checker-pulse.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ The following issue types are reported by this checker:
151151
- [DATA_FLOW_TO_SINK](/docs/next/all-issue-types#data_flow_to_sink)
152152
- [MEMORY_LEAK_C](/docs/next/all-issue-types#memory_leak_c)
153153
- [MEMORY_LEAK_CPP](/docs/next/all-issue-types#memory_leak_cpp)
154+
- [MUTUAL_RECURSION_CYCLE](/docs/next/all-issue-types#mutual_recursion_cycle)
154155
- [NIL_BLOCK_CALL](/docs/next/all-issue-types#nil_block_call)
155156
- [NIL_BLOCK_CALL_LATENT](/docs/next/all-issue-types#nil_block_call_latent)
156157
- [NIL_INSERTION_INTO_COLLECTION](/docs/next/all-issue-types#nil_insertion_into_collection)
@@ -175,8 +176,10 @@ The following issue types are reported by this checker:
175176
- [NULL_ARGUMENT_LATENT](/docs/next/all-issue-types#null_argument_latent)
176177
- [OPTIONAL_EMPTY_ACCESS](/docs/next/all-issue-types#optional_empty_access)
177178
- [OPTIONAL_EMPTY_ACCESS_LATENT](/docs/next/all-issue-types#optional_empty_access_latent)
179+
- [PULSE_CANNOT_INSTANTIATE_ABSTRACT_CLASS](/docs/next/all-issue-types#pulse_cannot_instantiate_abstract_class)
178180
- [PULSE_CONST_REFABLE](/docs/next/all-issue-types#pulse_const_refable)
179181
- [PULSE_DICT_MISSING_KEY](/docs/next/all-issue-types#pulse_dict_missing_key)
182+
- [PULSE_DYNAMIC_TYPE_MISMATCH](/docs/next/all-issue-types#pulse_dynamic_type_mismatch)
180183
- [PULSE_READONLY_SHARED_PTR_PARAM](/docs/next/all-issue-types#pulse_readonly_shared_ptr_param)
181184
- [PULSE_REFERENCE_STABILITY](/docs/next/all-issue-types#pulse_reference_stability)
182185
- [PULSE_RESOURCE_LEAK](/docs/next/all-issue-types#pulse_resource_leak)
@@ -195,6 +198,7 @@ The following issue types are reported by this checker:
195198
- [PULSE_UNNECESSARY_COPY_OPTIONAL_CONST](/docs/next/all-issue-types#pulse_unnecessary_copy_optional_const)
196199
- [PULSE_UNNECESSARY_COPY_RETURN](/docs/next/all-issue-types#pulse_unnecessary_copy_return)
197200
- [RETAIN_CYCLE](/docs/next/all-issue-types#retain_cycle)
201+
- [RETAIN_CYCLE_NO_WEAK_INFO](/docs/next/all-issue-types#retain_cycle_no_weak_info)
198202
- [SENSITIVE_DATA_FLOW](/docs/next/all-issue-types#sensitive_data_flow)
199203
- [STACK_VARIABLE_ADDRESS_ESCAPE](/docs/next/all-issue-types#stack_variable_address_escape)
200204
- [TAINT_ERROR](/docs/next/all-issue-types#taint_error)

website/static/man/next/infer-analyze.1.html

Lines changed: 54 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/static/man/next/infer-capture.1.html

Lines changed: 17 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/static/man/next/infer-compile.1.html

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)