summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/perl.c b/perl.c
index fd100cc64a..dc77e49f8b 100644
--- a/perl.c
+++ b/perl.c
@@ -261,6 +261,22 @@ perl_construct(pTHXx)
init_constants();
+ SvREADONLY_on(&PL_sv_placeholder);
+ SvREFCNT(&PL_sv_placeholder) = SvREFCNT_IMMORTAL;
+
+ PL_sighandlerp = (Sighandler_t) Perl_sighandler;
+#ifdef PERL_USES_PL_PIDSTATUS
+ PL_pidstatus = newHV();
+#endif
+
+ PL_rs = newSVpvs("\n");
+
+ init_stacks();
+
+/* The PERL_INTERNAL_RAND_SEED set-up must be after init_stacks because it calls
+ * things that may put SVs on the stack.
+ */
+
#ifdef NO_PERL_INTERNAL_RAND_SEED
Perl_drand48_init_r(&PL_internal_random_state, seed());
#else
@@ -277,18 +293,6 @@ perl_construct(pTHXx)
}
#endif
- SvREADONLY_on(&PL_sv_placeholder);
- SvREFCNT(&PL_sv_placeholder) = SvREFCNT_IMMORTAL;
-
- PL_sighandlerp = (Sighandler_t) Perl_sighandler;
-#ifdef PERL_USES_PL_PIDSTATUS
- PL_pidstatus = newHV();
-#endif
-
- PL_rs = newSVpvs("\n");
-
- init_stacks();
-
init_ids();
S_fixup_platform_bugs();