aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlistair Delva <adelva@google.com>2020-08-05 10:28:09 -0700
committerAlistair Delva <adelva@google.com>2020-08-05 10:43:35 -0700
commit3f3b1e4cad13e7fb74cd330dd1d5a93ecb41230c (patch)
treee87dc5d12a786cb8f108ed48db160f5f7225ca6d
parent343a64df887c437b2cec95e1ff13f8057733292b (diff)
downloadswig-3f3b1e4cad13e7fb74cd330dd1d5a93ecb41230c.tar.gz
javascript: replace exceptions with SWIG_exit
When building SWIG for Android, there is no support for C++ exceptions. In the cases there is "Illegal state", it seems more like an internal error, so we can replace the throw calls with a debug print and exit immediately. Bug: 162801433 Change-Id: I8096656f5a9f333ac2f4704438116ac8621b8193
-rw-r--r--Source/Modules/javascript.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/Modules/javascript.cxx b/Source/Modules/javascript.cxx
index d2b33b1b4..31576bd93 100644
--- a/Source/Modules/javascript.cxx
+++ b/Source/Modules/javascript.cxx
@@ -1575,7 +1575,8 @@ void JSCEmitter::marshalInputArgs(Node *n, ParmList *parms, Wrapper *wrapper, Ma
Printf(arg, "argv[%d]", i);
break;
default:
- throw "Illegal state.";
+ Printf(stdout, "Illegal state.");
+ SWIG_exit(EXIT_FAILURE);
}
tm = emitInputTypemap(n, p, wrapper, arg);
Delete(arg);
@@ -2212,7 +2213,8 @@ void V8Emitter::marshalInputArgs(Node *n, ParmList *parms, Wrapper *wrapper, Mar
Printf(arg, "args[%d]", i);
break;
default:
- throw "Illegal state.";
+ Printf(stdout, "Illegal state.");
+ SWIG_exit(EXIT_FAILURE);
}
tm = emitInputTypemap(n, p, wrapper, arg);