(perl #25933) always rethrow exceptions thrown through or by the XS implementation
authorTony Cook <tony@develop-help.com>
Mon, 11 Dec 2017 22:02:47 +0000 (23:02 +0100)
committerTony Cook <tony@develop-help.com>
Thu, 8 Feb 2018 02:58:13 +0000 (13:58 +1100)
commit06f586da4a0cc6d3663570f7be7e50654aa0e735
treeaf4dadfe0361c471e1e23cda681dd83732aa8a9b
parentfa575cfeda2da1b98c1c775b6262a4fe2ce8ca9e
(perl #25933) always rethrow exceptions thrown through or by the XS implementation

Also, preserve any references thrown.

Such references could be thrown by STORABLE_freeze, STORABLE_thaw or
STORABLE_attach implementations.

Several of the wrappers in Storable.pm had code similar to:

  eval { ... };
  logcroak $@ if $@ =~ s/\.?\n$/,/;

with $@ discarded if the condition failed.

This lead to two problems:

- exceptions not ending in "\n" (which is just references without
  string overloading, or with overloading but that didn't return a
  string ending in "\n") would not be rethrown.

- thrown references that did happen to have overloading that returned
  "\n" would be converted into strings.

This behaviour appears to have been present since the initial release
of Storable.
dist/Storable/__Storable__.pm
dist/Storable/t/blessed.t