perl5.004 hints file (maint and dev paths)
[p5sagit/p5-mst-13.2.git] / pp_sys.c
index 0447f38..1814a59 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -324,6 +324,23 @@ PP(pp_die)
        if(tmpsv ? SvROK(tmpsv) : SvROK(error)) {
            if(tmpsv)
                SvSetSV(error,tmpsv);
+           else if(sv_isobject(error)) {
+               HV *stash = SvSTASH(SvRV(error));
+               GV *gv = gv_fetchmethod(stash, "PROPAGATE");
+               if (gv) {
+                   SV *file = sv_2mortal(newSVsv(GvSV(curcop->cop_filegv)));
+                   SV *line = sv_2mortal(newSViv(curcop->cop_line));
+                   EXTEND(SP, 3);
+                   PUSHMARK(SP);
+                   PUSHs(error);
+                   PUSHs(file);
+                   PUSHs(line);
+                   PUTBACK;
+                   perl_call_sv((SV*)GvCV(gv),
+                                G_SCALAR|G_EVAL|G_KEEPERR);
+                   sv_setsv(error,*stack_sp--);
+               }
+           }
            pat = Nullch;
        }
        else {
@@ -476,7 +493,7 @@ PP(pp_umask)
     TAINT_PROPER("umask");
     XPUSHi(anum);
 #else
-    XPUSHs(&sv_undef)
+    XPUSHs(&sv_undef);
 #endif
     RETURN;
 }
@@ -1951,7 +1968,7 @@ PP(pp_ssockopt)
                buf = SvPV(sv, na);
                len = na;
            }
-           else if (SvOK(sv)) {
+           else {
                aint = (int)SvIV(sv);
                buf = (char*)&aint;
                len = sizeof(int);