Open
Description
Description
When using the experimental class
syntax in v5.38.0, we segfault if we inherit from an empty base class.
Steps to Reproduce
perl -E 'use experimental "class"; class Animal; class Dog :isa(Animal); say "Hello"'
Segmentation fault: 11
Defining the body of the Animal
class makes the error go away.
perl -E 'use experimental "class"; class Animal {}; class Dog :isa(Animal); say "Hello"'
Hello
Expected behavior
I would have expected the code above to print "Hello"
Perl configuration
Summary of my perl5 (revision 5 version 38 subversion 0) configuration:
Platform:
osname=darwin
osvers=22.5.0
archname=darwin-2level
uname='darwin ovids-m1-laptop.local 22.5.0 darwin kernel version 22.5.0: thu jun 8 22:22:20 pdt 2023; root:xnu-8796.121.3~7release_arm64_t6000 arm64 '
config_args='-de -Dprefix=/Users/ovid/perl5/perlbrew/perls/perl-5.38.0 -Aeval:scriptdir=/Users/ovid/perl5/perlbrew/perls/perl-5.38.0/bin'
hint=recommended
useposix=true
d_sigaction=define
useithreads=undef
usemultiplicity=undef
use64bitint=define
use64bitall=define
uselongdouble=undef
usemymalloc=n
default_inc_excludes_dot=define
Compiler:
cc='cc'
ccflags ='-fno-common -DPERL_DARWIN -mmacosx-version-min=13.4 -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -I/opt/local/include'
optimize='-O3'
cppflags='-fno-common -DPERL_DARWIN -mmacosx-version-min=13.4 -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -I/opt/local/include'
ccversion=''
gccversion='Apple LLVM 14.0.3 (clang-1403.0.22.14.1)'
gccosandvers=''
intsize=4
longsize=8
ptrsize=8
doublesize=8
byteorder=12345678
doublekind=3
d_longlong=define
longlongsize=8
d_longdbl=define
longdblsize=8
longdblkind=0
ivtype='long'
ivsize=8
nvtype='double'
nvsize=8
Off_t='off_t'
lseeksize=8
alignbytes=8
prototype=define
Linker and Libraries:
ld='cc'
ldflags =' -mmacosx-version-min=13.4 -fstack-protector-strong -L/usr/local/lib -L/opt/local/lib'
libpth=/usr/local/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.3/lib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /opt/local/lib /usr/lib
libs=
perllibs=
libc=
so=dylib
useshrplib=false
libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs
dlext=bundle
d_dlsymun=undef
ccdlflags=' '
cccdlflags=' '
lddlflags=' -mmacosx-version-min=13.4 -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib -fstack-protector-strong'
Characteristics of this binary (from libperl):
Compile-time options:
HAS_LONG_DOUBLE
HAS_STRTOLD
HAS_TIMES
PERLIO_LAYERS
PERL_COPY_ON_WRITE
PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_SIPHASH13
PERL_HASH_USE_SBOX32
PERL_MALLOC_WRAP
PERL_OP_PARENT
PERL_PRESERVE_IVUV
PERL_USE_SAFE_PUTENV
USE_64_BIT_ALL
USE_64_BIT_INT
USE_LARGE_FILES
USE_LOCALE
USE_LOCALE_COLLATE
USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC
USE_LOCALE_TIME
USE_PERLIO
USE_PERL_ATOF
Built under darwin
Compiled at Jul 4 2023 08:24:13
%ENV:
PERL5LIB="/Users/ovid/veure/t/tests:/Users/ovid/veure/t/shared:/Users/ovid/veure/t/admin:/Users/ovid/perlcustom/lib"
PERLBREW_HOME="/Users/ovid/.perlbrew"
PERLBREW_MANPATH="/Users/ovid/perl5/perlbrew/perls/perl-5.38.0/man"
PERLBREW_PATH="/Users/ovid/perl5/perlbrew/bin:/Users/ovid/perl5/perlbrew/perls/perl-5.38.0/bin"
PERLBREW_PERL="perl-5.38.0"
PERLBREW_ROOT="/Users/ovid/perl5/perlbrew"
PERLBREW_SHELLRC_VERSION="0.96"
PERLBREW_VERSION="0.96"
@INC:
/Users/ovid/veure/t/tests
/Users/ovid/veure/t/shared
/Users/ovid/veure/t/admin
/Users/ovid/perlcustom/lib
/Users/ovid/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0/darwin-2level
/Users/ovid/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0
/Users/ovid/perl5/perlbrew/perls/perl-5.38.0/lib/5.38.0/darwin-2level
/Users/ovid/perl5/perlbrew/perls/perl-5.38.0/lib/5.38.0