diff --git a/CHANGES.current b/CHANGES.current index e0b7f0897..23c800f94 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -7,6 +7,10 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/ Version 4.0.1 (in progress) =========================== +2019-06-28: wsfulton + [MzScheme, OCaml] #1559 $arg and $input were incorrectly substituted in the + argout typemap when two or more arguments were present. + 2019-06-24: wsfulton [Python, Ruby] #1538 Remove the UnknownExceptionHandler class in order to be C++17 compliant as it uses std::unexpected_handler which was removed in C++17. diff --git a/Source/Modules/mzscheme.cxx b/Source/Modules/mzscheme.cxx index 543874172..788681330 100644 --- a/Source/Modules/mzscheme.cxx +++ b/Source/Modules/mzscheme.cxx @@ -221,7 +221,6 @@ public: Wrapper *f = NewWrapper(); String *proc_name = NewString(""); - String *source = NewString(""); String *target = NewString(""); String *arg = NewString(""); String *cleanup = NewString(""); @@ -312,10 +311,9 @@ public: String *ln = Getattr(p, "lname"); // Produce names of source and target - Clear(source); Clear(target); Clear(arg); - Printf(source, "argv[%d]", i); + String *source = NewStringf("argv[%d]", i); Printf(target, "%s", ln); Printv(arg, Getattr(p, "name"), NIL); @@ -339,6 +337,7 @@ public: if (i >= numreq) { Printf(f->code, "}\n"); } + Delete(source); } /* Insert constraint checking code */ @@ -465,7 +464,6 @@ public: } Delete(proc_name); - Delete(source); Delete(target); Delete(arg); Delete(outarg); diff --git a/Source/Modules/ocaml.cxx b/Source/Modules/ocaml.cxx index ad9c94800..6f2a34962 100644 --- a/Source/Modules/ocaml.cxx +++ b/Source/Modules/ocaml.cxx @@ -473,7 +473,6 @@ public: Wrapper *f = NewWrapper(); String *proc_name = NewString(""); - String *source = NewString(""); String *target = NewString(""); String *arg = NewString(""); String *cleanup = NewString(""); @@ -580,10 +579,9 @@ public: pt = SwigType_typedef_qualified(pt); // Produce names of source and target - Clear(source); Clear(target); Clear(arg); - Printf(source, "caml_list_nth(args,%d)", i); + String *source = NewStringf("caml_list_nth(args,%d)", i); Printf(target, "%s", ln); Printv(arg, Getattr(p, "name"), NIL); @@ -607,6 +605,7 @@ public: if (i >= numreq) { Printf(f->code, "}\n"); } + Delete(source); } /* Insert constraint checking code */ @@ -787,7 +786,6 @@ public: Printf(f_mlibody, "val %s : c_obj -> c_obj\n", mangled_name); Delete(proc_name); - Delete(source); Delete(target); Delete(arg); Delete(outarg);