Stop SVt_REGEXPs from being upgraded.
Any code that is going to write over a REGEXP will call
sv_force_normal first, which converts it to
This code started crashing in 5.12:
$_ = qr//;
@INC = sub { $_ };
require foo;
Search pattern not terminated at /loader/0x7fe3b082c2e8/foo.pm line 1.
Compilation failed in require at - line 4.
Segmentation fault: 11
With current bleadperl:
foo.pm did not return a true value at - line 4.
Segmentation fault: 11
This change makes it like this instead:
Can't upgrade REGEXP (8) to 15 at - line 3.
which is certainly an improvement. We shouldn’t be getting any error
at all (OK, just a syntax error because (?^:) is not a valid expres-
sion), and the next commit will fix that, but this commit at least
turns a crash into a panic, in case future changes accidentally send a
regexp through sv_upgrade(sv, SVt_PVIO).