Skip to content

Commit

Permalink
Small documentation adjustment
Browse files Browse the repository at this point in the history
Summary: It seems slightly better to mention that `this` is `Argument(0)` in the section about access paths. This seems to be a common source of confusion for newcomers.

Reviewed By: anwesht

Differential Revision: D62852455

fbshipit-source-id: da60a26f68d3934636442d89ee5c77cfa6618c14
  • Loading branch information
arthaud authored and facebook-github-bot committed Sep 17, 2024
1 parent 2ec7ce0 commit cd53ac7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions documentation/website/documentation/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ For the parameters and return types use the following table to pick the correct
- F - float
- D - double (64 bits)

Classes take the form `Lpackage/name/ClassName;` - where the leading `L` indicates that it is a class type, `package/name/` is the package that the class is in. A nested class will take the form `Lpackage/name/ClassName$NestedClassName` (the `$` will need to be double escaped `\\$` in json regex).

> **NOTE 1:** Instance (i.e, non-static) method parameters are indexed starting from 1! The 0th parameter is the `this` parameter in dalvik byte-code. For static method parameters, indices start from 0.
> **NOTE 2:** In a constructor (\<init\> method), parameters are also indexed starting from 1. The 0th parameter refers to the instance being constructed, similar to the `this` reference.
Classes take the form `Lpackage/name/ClassName;` - where the leading `L` indicates that it is a class type, `package/name/` is the package that the class is in. A nested class will take the form `Lpackage/name/ClassName$NestedClassName;` (the `$` will need to be double escaped `\\$` in json regex).

### Access path format

Expand All @@ -88,7 +84,7 @@ An access path is composed of a root and a path.
The root is either:

- `Return`, representing the returned value;
- `Argument(x)` (where `x` is an integer), representing the parameter number `x`;
- `Argument(x)` (where `x` is an integer), representing the parameter number `x`. **Note** that `Argument(0)` represents the implicit `this` parameter for instance methods;

The path is a (possibly empty) list of path elements. A path element can be any of the following kinds:

Expand All @@ -106,6 +102,10 @@ Examples:
- `Return` corresponds to the returned value;
- `Return.x` corresponds to the field `x` of the returned value;

> **NOTE 1:** Instance (i.e, non-static) method parameters are indexed starting from 1! The 0th parameter is the `this` parameter in Dalvik byte-code. For static method parameters, indices start from 0.
> **NOTE 2:** In a constructor (`<init>` method), parameters are also indexed starting from 1. The 0th parameter refers to the instance being constructed, similar to the `this` reference.
### Kinds

A source has a **kind** that describes its content (e.g, user input, file system, etc). A sink also has a **kind** that describes the operation the method performs (e.g, execute a command, read a file, etc.). Kinds can be arbitrary strings (e.g, `UserInput`). We usually avoid whitespaces.
Expand Down

0 comments on commit cd53ac7

Please sign in to comment.