Skip to content

Commit 2ae06df

Browse files
cortinicofacebook-github-bot
authored andcommitted
Let react_native_assert really abort the app
Summary: Fixed a bug in `react_native_assert` that was not effectively letting the app call `abort()`. The app was actually printing on log twice. Ref: https://developer.android.com/ndk/reference/group/logging#__android_log_assert Changelog: [Android] [Changed] - Let react_native_assert really abort the app Reviewed By: JoshuaGross Differential Revision: D32204080 fbshipit-source-id: ca16c50aaf4e41a2318277c233be0e944b2ad8f1
1 parent 1814649 commit 2ae06df

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ReactCommon/react/debug/react_native_assert.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern "C" void react_native_assert_fail(
2222
const char *file,
2323
int line,
2424
const char *expr) {
25-
// Print as an error so it shows up in logcat before crash....
25+
// Print as an error so it shows up in logcat before crash...
2626
__android_log_print(
2727
ANDROID_LOG_ERROR,
2828
"ReactNative",
@@ -31,9 +31,9 @@ extern "C" void react_native_assert_fail(
3131
line,
3232
func,
3333
expr);
34-
// Print as a fatal so it crashes and shows up in uploaded logs
35-
__android_log_print(
36-
ANDROID_LOG_FATAL,
34+
// ...and trigger an abort so it crashes and shows up in uploaded logs.
35+
__android_log_assert(
36+
nullptr,
3737
"ReactNative",
3838
"%s:%d: function %s: assertion failed (%s)",
3939
file,

0 commit comments

Comments
 (0)