swig/Examples/perl5/xmlstring
William S Fulton a1e619b7cb argcargv / OOM-protection follow-ups
- [Lua] Fix off-by-one when nil terminates the table early: use $1 = i
  (not i + 1) to match the count of strings actually copied, and pop
  the nil from the Lua stack before breaking.

- [Python] In SWIG_AsCharPtrAndSize (pystrings.swg) decref bytes / obj
  on the SWIG_MemoryError early returns added by the previous commits,
  so an allocation failure no longer leaks the temporary PyObject.

- [Octave, Python] In argcargv.i free already-allocated string entries
  and the array itself before failing on a per-element OOM (Python uses
  the existing break path so the freearg typemap performs the cleanup).

- [Perl, PHP, Tcl] Drop unreachable `goto fail` after SWIG_croak /
  SWIG_PHP_Error / SWIG_exception_fail, all of which already invoke
  SWIG_fail. Compilers warning on unreachable code complained.

- Standardise the OOM error wording across languages and fix the
  3- and 5-space indentation introduced by the previous commits.

- Update Examples/perl5/xmlstring/xmlstring.i to the new
  %typemaps_string signature (it picks up the missing WarningLeakMsg
  argument too) and add a SWIG_NewCopyXMLChArray fragment.

- CHANGES.current: document the API breakages introduced by removing
  %new_copy_array, removing %typemaps_string_alloc and extending
  %typemaps_string, including the actual error text users will see.

Assisted-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 21:01:30 +01:00
..
Makefile Remove use of preinst-swig script 2015-08-21 22:43:17 +01:00
example.cxx treat XMLCh properly using %typemaps_string 2006-01-04 20:20:33 +00:00
example.h treat XMLCh properly using %typemaps_string 2006-01-04 20:20:33 +00:00
example.i treat XMLCh properly using %typemaps_string 2006-01-04 20:20:33 +00:00
runme.pl add missing typecheck codes and Char typemaps 2006-01-04 21:46:27 +00:00
xmlstring.i argcargv / OOM-protection follow-ups 2026-05-19 21:01:30 +01:00