cache ERRSV in a local variable
[p5sagit/Function-Parameters.git] / Parameters.xs
index ec46ef3..282bb03 100644 (file)
@@ -774,9 +774,11 @@ static size_t count_named_params(const ParamSpec *ps) {
 }
 
 static void my_require(pTHX_ const char *file) {
+       SV *err;
        require_pv(file);
-       if (SvTRUE(ERRSV)) {
-               croak_sv(ERRSV);
+       err = ERRSV;
+       if (SvTRUE(err)) {
+               croak_sv(err);
        }
 }