‘sub CORE::GLOBAL::do;’ doesn’t create a full glob, but cheats
for efficiency. Compilation of do-file ops was not taking this
into account.
if (!(gv && GvCVu(gv) && GvIMPORTED_CV(gv))) {
GV * const * const gvp = (GV**)hv_fetchs(PL_globalstash, "do", FALSE);
gv = gvp ? *gvp : NULL;
+ if (gv && !isGV(gv)) gv_init(gv, PL_globalstash, "do", 2, 0);
}
}
chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
+ require Config; # load these before we mess with *CORE::GLOBAL::require
+ require 'Config_heavy.pl'; # since runperl will need them
}
-plan tests => 29;
+plan tests => 30;
#
# This file tries to test builtin override using CORE::GLOBAL
sub caller() { 42 }
caller; # inline the constant
is caller, 42, 'constant inlining does not undo "use subs" on keywords';
+
+is runperl(prog => 'sub CORE::GLOBAL::do; do file; print qq-ok\n-'),
+ "ok\n",
+ 'no crash with CORE::GLOBAL::do stub';