develooper Front page | perl.perl5.porters | Postings from January 2001

[ID 20010131.001] Class::Struct autogenerated 'new' method causesinfinite loop

January 31, 2001 01:02
[ID 20010131.001] Class::Struct autogenerated 'new' method causesinfinite loop
Message ID:
This is a bug report for perl from,
generated with the help of perlbug 1.20 running under perl 5.00404.

[Please enter your report here]

Consider the following sample program:

	package Person;
	use Class::Struct;
	struct Person => 
	   name => '$',
	   spouse => 'Person',

	package main;
	my $z = Person->new;

The 'new' method generated here is:

        sub new {
          my($r) = {};
          $r->{'name'} = undef;
          $r->{'spouse'} = 'Person'->new();
          bless $r;

so that the Person::new function calls itself in an infinite recursion.

[Please do not change anything below this line]

Site configuration information for perl 5.00404:

Configured by wpm at Wed Nov 26 16:55:08 EST 1997.

Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
    osname=solaris, osvers=2.5.1, archname=sun4-solaris
    uname='sunos zappa 5.5.1 generic_103640-12-1 sun4u sparc sunw,ultra-1 '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=y useperlio=undef d_sfio=undef
    cc='/ms/dist/fsf/PROJ/gcc/', optimize='-O', gccversion=2.7.2
    cppflags='-DDEBUGGING_MSTATS -DPERL_EMERGENCY_SBRK -DPACK_MALLOC -DTWO_POT_OPTIMIZE -I/ms/dist/aurora/include -I/ms/dist/fsf/include'
    ccflags ='-DDEBUGGING_MSTATS -DPERL_EMERGENCY_SBRK -DPACK_MALLOC -DTWO_POT_OPTIMIZE -I/ms/dist/aurora/include -I/ms/dist/fsf/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='/ms/dist/fsf/PROJ/gcc/', ldflags =' -L/ms/dist/aurora/lib -L/ms/dist/fsf/lib'
    libpth=/ms/dist/aurora/lib /ms/dist/fsf/lib /lib /usr/lib /usr/ccs/lib /usr/local/lib
    libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt
    libc=/lib/, so=so
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/ms/dist/aurora/lib -L/ms/dist/fsf/lib'

Locally applied patches:

@INC for perl 5.00404:

Environment for perl 5.00404:
    LOGDIR (unset)
    PERL_BADLANG (unset)
    SHELL=/bin/ksh Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About