]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
Simplify vmg_propagate_errsv_free() so that ERRSV is not used as a lvalue rt101410
authorVincent Pit <vince@profvince.com>
Tue, 10 Mar 2015 20:02:17 +0000 (17:02 -0300)
committerVincent Pit <vince@profvince.com>
Tue, 10 Mar 2015 20:02:17 +0000 (17:02 -0300)
Magic.xs

index 341950240c2934e870148a23b6f4a05304372f71..5ca81e35766050b99b966877a513d6eb32420903 100644 (file)
--- a/Magic.xs
+++ b/Magic.xs
@@ -1386,11 +1386,8 @@ STATIC OP *vmg_pp_propagate_errsv(pTHX) {
 #endif /* VMG_PROPAGATE_ERRSV_NEEDS_TRAMPOLINE */
 
 STATIC int vmg_propagate_errsv_free(pTHX_ SV *sv, MAGIC *mg) {
- if (mg->mg_obj) {
-  ERRSV         = mg->mg_obj;
-  mg->mg_obj    = NULL;
-  mg->mg_flags &= ~MGf_REFCOUNTED;
- }
+ if (mg->mg_obj)
+  sv_setsv(ERRSV, mg->mg_obj);
 
  return 0;
 }