mirror of https://github.com/swig/swig
handle `"tmap:in" == NULL`
Even if this can't really happen in practice
This commit is contained in:
parent
df22fad547
commit
55207d5e52
|
@ -1406,13 +1406,19 @@ String *JSEmitter::emitInputTypemap(Node *n, Parm *p, Wrapper *wrapper, String *
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(type, 0));
|
Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(type, 0));
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_optional) {
|
if (is_optional) {
|
||||||
Printf(code, "}\n");
|
Printf(code, "}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
Append(wrapper->code, code);
|
// numinputs=0 typemaps are emitted by the legacy code in
|
||||||
|
// emit_attach_parmmaps() in emit.cxx, check the comment there
|
||||||
|
// All generators work around this
|
||||||
|
if (!checkAttribute(p, "tmap:in:numinputs", "0")) {
|
||||||
|
Append(wrapper->code, code);
|
||||||
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1700,10 +1706,7 @@ void JSCEmitter::marshalInputArgs(Node *n, ParmList *parms, Wrapper *wrapper, Ma
|
||||||
Exit(EXIT_FAILURE);
|
Exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// numinputs=0 typemaps are emitted by the legacy code in
|
tm = emitInputTypemap(n, p, wrapper, arg);
|
||||||
// emit_attach_parmmaps() in emit.cxx, check the comment there
|
|
||||||
if (!checkAttribute(p, "tmap:in:numinputs", "0"))
|
|
||||||
tm = emitInputTypemap(n, p, wrapper, arg);
|
|
||||||
Delete(arg);
|
Delete(arg);
|
||||||
|
|
||||||
if (tm) {
|
if (tm) {
|
||||||
|
@ -2368,11 +2371,7 @@ void V8Emitter::marshalInputArgs(Node *n, ParmList *parms, Wrapper *wrapper, Mar
|
||||||
Exit(EXIT_FAILURE);
|
Exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// numinputs=0 typemaps are emitted by the legacy code in
|
tm = emitInputTypemap(n, p, wrapper, arg);
|
||||||
// emit_attach_parmmaps() in emit.cxx, check the comment there
|
|
||||||
// All language backends work around this
|
|
||||||
if (!checkAttribute(p, "tmap:in:numinputs", "0"))
|
|
||||||
tm = emitInputTypemap(n, p, wrapper, arg);
|
|
||||||
Delete(arg);
|
Delete(arg);
|
||||||
|
|
||||||
if (tm) {
|
if (tm) {
|
||||||
|
@ -2938,11 +2937,7 @@ void NAPIEmitter::marshalInputArgs(Node *n, ParmList *parms, Wrapper *wrapper, M
|
||||||
Exit(EXIT_FAILURE);
|
Exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetInt(p, "tmap:in:numinputs") != 0) {
|
tm = emitInputTypemap(n, p, wrapper, arg);
|
||||||
// in typemaps with numinputs=0 are a special case
|
|
||||||
// and are handled in emit.cxx:emit_attach_parmmaps()
|
|
||||||
tm = emitInputTypemap(n, p, wrapper, arg);
|
|
||||||
}
|
|
||||||
Delete(arg);
|
Delete(arg);
|
||||||
|
|
||||||
if (tm) {
|
if (tm) {
|
||||||
|
|
Loading…
Reference in New Issue