Fix bug in emit_action.
Before, it was possible that two catch(...) blocks were generated (for varargs and undefined typemap). From: Oliver Buchtala <oliver.buchtala@googlemail.com> git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13511 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
196f9b31ed
commit
18aa801bd0
1 changed files with 4 additions and 2 deletions
|
|
@ -470,6 +470,7 @@ String *emit_action(Node *n) {
|
|||
|
||||
if (catchlist) {
|
||||
int unknown_catch = 0;
|
||||
int has_varargs = 0;
|
||||
Printf(eaction, "}\n");
|
||||
for (Parm *ep = catchlist; ep; ep = nextSibling(ep)) {
|
||||
String *em = Swig_typemap_lookup("throws", ep, "_e", 0);
|
||||
|
|
@ -480,6 +481,7 @@ String *emit_action(Node *n) {
|
|||
Printf(eaction, "catch(%s) {", SwigType_str(et, "_e"));
|
||||
} else if (SwigType_isvarargs(etr)) {
|
||||
Printf(eaction, "catch(...) {");
|
||||
has_varargs = 1;
|
||||
} else {
|
||||
Printf(eaction, "catch(%s) {", SwigType_str(et, "&_e"));
|
||||
}
|
||||
|
|
@ -490,8 +492,8 @@ String *emit_action(Node *n) {
|
|||
unknown_catch = 1;
|
||||
}
|
||||
}
|
||||
if (unknown_catch) {
|
||||
Printf(eaction, "catch(...) { throw; }\n");
|
||||
if (unknown_catch && !has_varargs) {
|
||||
Printf(eaction, "catch(...) { throw; }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue