--- JSON-XS/XS.xs 2009/07/03 09:38:30 1.97 +++ JSON-XS/XS.xs 2009/07/17 14:33:45 1.98 @@ -473,7 +473,7 @@ // actually, this is mostly due to the stupid so-called // security workaround added somewhere in 5.8.x // that randomises hash orderings - if (enc->json.flags & F_CANONICAL) + if (enc->json.flags & F_CANONICAL && !SvRMAGICAL (hv)) { int count = hv_iterinit (hv);