exit properly when getting wrong number of args
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7700 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
2ff3dd0d4e
commit
dbce71f7a8
1 changed files with 6 additions and 6 deletions
|
|
@ -1155,19 +1155,19 @@ public:
|
|||
} else if (current == CONSTRUCTOR_INITIALIZE) {
|
||||
Printv(f->def, "SWIGINTERN VALUE\n", wname, "(int argc, VALUE *argv, VALUE self) {", NIL);
|
||||
if (!varargs) {
|
||||
Printf(f->code,"if ((argc < %d) || (argc > %d))\n", numreq-start, numarg-start);
|
||||
Printf(f->code,"if ((argc < %d) || (argc > %d)) ", numreq-start, numarg-start);
|
||||
} else {
|
||||
Printf(f->code,"if (argc < %d)\n", numreq-start);
|
||||
Printf(f->code,"if (argc < %d) ", numreq-start);
|
||||
}
|
||||
Printf(f->code,"rb_raise(rb_eArgError, \"wrong # of arguments(%%d for %d)\",argc);\n",numreq-start);
|
||||
Printf(f->code,"{rb_raise(rb_eArgError, \"wrong # of arguments(%%d for %d)\",argc); return Qnil;}\n",numreq-start);
|
||||
} else {
|
||||
Printv(f->def, "SWIGINTERN VALUE\n", wname, "(int argc, VALUE *argv, VALUE self) {", NIL);
|
||||
if (!varargs) {
|
||||
Printf(f->code,"if ((argc < %d) || (argc > %d))\n", numreq-start, numarg-start);
|
||||
Printf(f->code,"if ((argc < %d) || (argc > %d)) ", numreq-start, numarg-start);
|
||||
} else {
|
||||
Printf(f->code,"if (argc < %d)\n", numreq-start);
|
||||
Printf(f->code,"if (argc < %d) ", numreq-start);
|
||||
}
|
||||
Printf(f->code,"rb_raise(rb_eArgError, \"wrong # of arguments(%%d for %d)\",argc);\n",numreq-start);
|
||||
Printf(f->code,"{rb_raise(rb_eArgError, \"wrong # of arguments(%%d for %d)\",argc); return Qnil;}\n",numreq-start);
|
||||
}
|
||||
|
||||
/* Now walk the function parameter list and generate code */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue