-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FlowChecker: Fix segfault with error reporting parameter name
Summary: It's possible that the parameter doesn't have a name when reporting an error, so check before dereferencing it. Reviewed By: tmikov Differential Revision: D66665056 fbshipit-source-id: 7e89b8aecf2c47ab7cc24d72e074336acddc20a7
- Loading branch information
1 parent
92984b4
commit 2dd2314
Showing
2 changed files
with
30 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// RUN: (! %shermes -Werror -ferror-limit=0 -typed -dump-sema %s 2>&1 ) | %FileCheckOrRegen --match-full-lines %s | ||
|
||
function f(cb: number => string) { | ||
cb('a'); | ||
} | ||
|
||
// Auto-generated content below. Please do not modify manually. | ||
|
||
// CHECK:{{.*}}regress-function-param-no-name-error.js:11:6: error: ft: function parameter #1 type mismatch | ||
// CHECK-NEXT: cb('a'); | ||
// CHECK-NEXT: ^~~ | ||
// CHECK-NEXT:Emitted 1 errors. exiting. |