-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pulse] suppress mutual recursion reports when heap progress has been…
… made Summary: This usually indicates the recursion is intended as we are traversing an inductive data structure. Could miss real bugs caused by cycles in the heap in other calling contexts. Reviewed By: skcho Differential Revision: D66667343 Privacy Context Container: L1208441 fbshipit-source-id: 64fd07d914168a5d6fa27734a249720e0057486a
- Loading branch information
1 parent
c269e0f
commit e995511
Showing
7 changed files
with
116 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright (c) Facebook, Inc. and its affiliates. | ||
// | ||
// This source code is licensed under the MIT license found in the | ||
// LICENSE file in the root directory of this source tree. | ||
|
||
class Node { | ||
private Node $next; | ||
private int $data; | ||
|
||
public function __construct(int $data, Node $next) { | ||
$this->data = $data; | ||
$this->next = $next; | ||
} | ||
|
||
public function length_ok(): int { | ||
if ($this->next == null) { | ||
return 1; | ||
} | ||
return 1 + $this->next->length_ok(); | ||
} | ||
|
||
// progress in callee | ||
public function interproc_progress_ok(Node $list): void { | ||
$this->interproc2_ok($list); | ||
} | ||
|
||
private function interproc2_ok(Node $list): void { | ||
$this->interproc_progress_ok($list->next); | ||
} | ||
|
||
// progress before callee | ||
public function other_interproc_progress_ok(Node $list): void { | ||
$this->other_interproc2_ok($list->next); | ||
} | ||
|
||
private function other_interproc2_ok(Node $list): void { | ||
$this->other_interproc_progress_ok($list); | ||
} | ||
|
||
public function infinite_bad(Node $something, Node $other): int { | ||
return $this->infinite_bad($other, $something); | ||
} | ||
} |