Closed Bug 1692391 Opened 4 years ago Closed 4 years ago

Clean up nsObjCExceptions.h

Categories

(Core :: Widget: Cocoa, task, P2)

All
macOS
task

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(9 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Step 1 of bug 1692375.

This macro was quite misguided, too. If evaluating _e raised an exception, then
the expression value of the block would be an uninitialized value. Super unsafe.
It's a good thing that we don't expect "retain" to ever throw.

Depends on D104953

This patch was generated automatically with the commands below:

rg -l 'NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN' . | xargs sed -i '' -e 's/NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN/NS_OBJC_BEGIN_TRY_BLOCK_RETURN/g'
rg -l 'NS_OBJC_END_TRY_ABORT_BLOCK_RETURN' . | xargs sed -i '' -e 's/NS_OBJC_END_TRY_ABORT_BLOCK_RETURN/NS_OBJC_END_TRY_BLOCK_RETURN/g'

Depends on D104954

This patch was generated with the commands:

rg -l 'NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT' . | xargs sed -i '' -e 's/NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT/NS_OBJC_BEGIN_TRY_BLOCK_RETURN/g'
rg -l 'NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT' . | xargs sed -i '' -e 's/NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT/NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE)/g'

Depends on D104955

rg -l 'NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSNULL' . | xargs sed -i '' -e 's/NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSNULL/NS_OBJC_BEGIN_TRY_BLOCK_RETURN/g'
rg -l 'NS_OBJC_END_TRY_ABORT_BLOCK_NSNULL' . | xargs sed -i '' -e 's/NS_OBJC_END_TRY_ABORT_BLOCK_NSNULL/NS_OBJC_END_TRY_BLOCK_RETURN(nullptr)/g'

Depends on D104957

This patch was generated automatically, using the following commands:

rg -l 'NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL' . | xargs sed -i '' -e 's/NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL/NS_OBJC_BEGIN_TRY_BLOCK_RETURN/g'
rg -l 'NS_OBJC_END_TRY_ABORT_BLOCK_NIL' . | xargs sed -i '' -e 's/NS_OBJC_END_TRY_ABORT_BLOCK_NIL/NS_OBJC_END_TRY_BLOCK_RETURN(nil)/g'

Depends on D104958

This patch was generated automatically, using the following commands:

rg -l 'NS_OBJC_BEGIN_TRY_ABORT_BLOCK' . | xargs sed -i '' -e 's/NS_OBJC_BEGIN_TRY_ABORT_BLOCK/NS_OBJC_BEGIN_TRY_IGNORE_BLOCK/g'
rg -l 'NS_OBJC_END_TRY_ABORT_BLOCK' . | xargs sed -i '' -e 's/NS_OBJC_END_TRY_ABORT_BLOCK/NS_OBJC_END_TRY_IGNORE_BLOCK/g'

Depends on D104959

Blocks: 1692401
Severity: -- → S2
Priority: -- → P2
Pushed by mstange@themasta.com: https://hg.mozilla.org/integration/autoland/rev/a4e5c4029485 Clean up nsObjCExceptions.h a little bit, and use -[NSException callStackSymbols] instead of manual symbolication. r=haik https://hg.mozilla.org/integration/autoland/rev/0752d57870a8 Remove some unused macros from nsObjCExceptions.h. r=haik https://hg.mozilla.org/integration/autoland/rev/a482a8905de3 Remove NS_OBJC_TRY_ABORT macro and replace its uses with the block version of the macro. r=haik https://hg.mozilla.org/integration/autoland/rev/402b9b231f31 Remove NS_OBJC_TRY_EXPR_ABORT macro and replace its use with the block version of the macro. r=haik https://hg.mozilla.org/integration/autoland/rev/aec9965dcb28 Remove the word ABORT from the NS_OBJC_BEGIN/END_TRY_ABORT_BLOCK_RETURN macros, because these macros don't abort. r=haik,necko-reviewers https://hg.mozilla.org/integration/autoland/rev/ea0609de088e Replace the NS_OBJC_BEGIN/END_TRY_ABORT_BLOCK_NSRESULT macros with the functionally identical NS_OBJC_BEGIN/END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE). r=haik https://hg.mozilla.org/integration/autoland/rev/1fdeba3fdb5f Replace NS_OBJC_BEGIN/END_TRY_ABORT_BLOCK_NSNULL with the functionally identical NS_OBJC_BEGIN/END_TRY_BLOCK_RETURN(nullptr). r=haik https://hg.mozilla.org/integration/autoland/rev/5e5084149f95 Replace NS_OBJC_BEGIN/END_TRY_ABORT_BLOCK_NIL with the functionally identical NS_OBJC_BEGIN/END_TRY_BLOCK_RETURN(nil). r=haik https://hg.mozilla.org/integration/autoland/rev/779a0465d293 Rename NS_OBJC_BEGIN/END_TRY_ABORT_BLOCK macros, replacing ABORT with IGNORE. These macros just log the exception and move on, without aborting. r=haik
Blocks: 1744861
Regressions: 1975224
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: