--- JSON-XS/XS.xs 2008/09/29 03:09:27 1.93 +++ JSON-XS/XS.xs 2008/11/20 03:59:53 1.94 @@ -1412,7 +1412,13 @@ STRLEN offset; SV *sv; - SvGETMAGIC (string); + /* work around bugs in 5.10 where manipulating magic values + * will perl ignore the magic in subsequent accesses + */ + /*SvGETMAGIC (string);*/ + if (SvMAGICAL (string)) + string = sv_2mortal (newSVsv (string)); + SvUPGRADE (string, SVt_PV); /* work around a bug in perl 5.10, which causes SvCUR to fail an