Open Bug 1541433 Opened 6 years ago Updated 2 months ago

Add a static analysis that detects Promises that are dropped on the floor

Categories

(Developer Infrastructure :: Source Code Analysis, task, P3)

Tracking

(Not tracked)

People

(Reporter: ehsan.akhgari, Unassigned)

References

Details

See https://bugzilla.mozilla.org/show_bug.cgi?id=1498102#c54 and the resulting fix (https://hg.mozilla.org/integration/autoland/rev/3236fd896ae0).

The interesting pattern to detect here is when we have:

void f() {
  RefPtr<Promise> promise = foo();

  // promise won't escape
}

We should statically verify that the promise is either passed to something (e.g. returned to the caller or passed to another function) or a method that adds a rejection handler to it is called on it, like AppendNativeHandler(), Then(), etc.

The priority flag is not set for this bug.
:sylvestre, could you have a look please?

Flags: needinfo?(sledru)
Type: defect → task
Flags: needinfo?(sledru)
Priority: -- → P3
Product: Firefox Build System → Developer Infrastructure
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.