Skip to content

Commit

Permalink
Suppress uncounted local var warning in RETURN_IF_EXCEPTION
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=273697

Reviewed by Ryosuke Niwa.

Add a macro to supress warning on the vm variable not being counted when
the preprocessor expands the RETURN_IF_EXCEPTION macro in a function
body.

This patch removes more than 2000 warnings when checking all the webkit
codebase.

* Source/JavaScriptCore/runtime/ExceptionScope.h:

Canonical link: https://commits.webkit.org/278560@main
  • Loading branch information
mikhailramalho committed May 9, 2024
1 parent 63865fa commit 00b3425
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/JavaScriptCore/runtime/ExceptionScope.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class ExceptionScope {
#endif // ENABLE(EXCEPTION_SCOPE_VERIFICATION)

#define RETURN_IF_EXCEPTION(scope__, value__) do { \
JSC::VM& vm = (scope__).vm(); \
SUPPRESS_UNCOUNTED_LOCAL JSC::VM& vm = (scope__).vm(); \
EXCEPTION_ASSERT(!!(scope__).exception() == vm.traps().needHandling(JSC::VMTraps::NeedExceptionHandling)); \
if (UNLIKELY(vm.traps().maybeNeedHandling())) { \
if (vm.hasExceptionsAfterHandlingTraps()) \
Expand Down

0 comments on commit 00b3425

Please sign in to comment.