Skip to content

Commit 84adc85

Browse files
appdenfacebook-github-bot
authored andcommitted
Export exception classes with default visibility
Summary: This fixes a crash caused by a `JSError` exception not being successfully caught in a different dynamic library from where it was thrown. Since the libraries were compiled with hidden symbols and loaded with `RTLD_LOCAL`, the exception typeinfo becomes unique to each module. Reading on this subject: https://gcc.gnu.org/wiki/Visibility https://stackoverflow.com/questions/14268736/symbol-visibility-exceptions-runtime-error Reviewed By: mhorowitz Differential Revision: D19343161 fbshipit-source-id: 4eb3bc2576bbcca2c3aef4f52b5a27dfde214c6a
1 parent 475df06 commit 84adc85

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ReactCommon/jsi/jsi/jsi.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ class Scope {
11911191
};
11921192

11931193
/// Base class for jsi exceptions
1194-
class JSIException : public std::exception {
1194+
class JSI_EXPORT JSIException : public std::exception {
11951195
protected:
11961196
JSIException(){};
11971197
JSIException(std::string what) : what_(std::move(what)){};
@@ -1207,15 +1207,15 @@ class JSIException : public std::exception {
12071207

12081208
/// This exception will be thrown by API functions on errors not related to
12091209
/// JavaScript execution.
1210-
class JSINativeException : public JSIException {
1210+
class JSI_EXPORT JSINativeException : public JSIException {
12111211
public:
12121212
JSINativeException(std::string what) : JSIException(std::move(what)) {}
12131213
};
12141214

12151215
/// This exception will be thrown by API functions whenever a JS
12161216
/// operation causes an exception as described by the spec, or as
12171217
/// otherwise described.
1218-
class JSError : public JSIException {
1218+
class JSI_EXPORT JSError : public JSIException {
12191219
public:
12201220
/// Creates a JSError referring to provided \c value
12211221
JSError(Runtime& r, Value&& value);

0 commit comments

Comments
 (0)