Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erroneous line numbers reported with '#line' in 'eval' #4360

Closed
p5pRT opened this issue Aug 29, 2001 · 7 comments
Closed

Erroneous line numbers reported with '#line' in 'eval' #4360

p5pRT opened this issue Aug 29, 2001 · 7 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 29, 2001

Migrated from rt.perl.org#7600 (status was 'rejected')

Searchable as RT7600$

@p5pRT
Copy link
Author

p5pRT commented Aug 29, 2001

From @mjdominus

  perl -le 'eval "#line 12 xyz\n1/0;"; print $@​'
  Illegal division by zero at xyz line 12.

This is correct.

  perl -le 'eval "#line 12 xyz\n1/0"; print $@​'
  Illegal division by zero at xyz line 13.

This wrong. It should report the error at line 12, not at
line 13.

  perl -le 'eval "#line 12 xyz\n1/0\n\n\n\n"; print $@​'
  Illegal division by zero at xyz line 17.

This is wronger.

  perl -le 'eval "#line 12 xyz\n1/0\n\n\n\n;"; print $@​'
  Illegal division by zero at xyz line 17.

Still wrong.

Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl v5.6.1:

Configured by mjd at Mon Apr  9 13:10:50 EDT 2001.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.2.16, archname=i586-linux
    uname='linux plover 2.2.16 #5 wed sep 27 19:05:46 edt 2000 i586 unknown '
    config_args='-des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lposix -lcrypt -lutil
    libc=/lib/libc-2.1.3.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    


@INC for perl v5.6.1:
    /usr/local/lib/perl5/5.6.1/i586-linux
    /usr/local/lib/perl5/5.6.1
    /usr/local/lib/perl5/site_perl/5.6.1/i586-linux
    /usr/local/lib/perl5/site_perl/5.6.1
    /usr/local/lib/perl5/site_perl/5.6.0/i586-linux
    /usr/local/lib/perl5/site_perl/5.6.0
    /usr/local/lib/perl5/site_perl
    .


Environment for perl v5.6.1:
    HOME=/home/mjd
    LANG (unset)
    LANGUAGE (unset)
    LC_ALL=POSIX
    LD_LIBRARY_PATH=/lib:/usr/lib:/usr/X11R6/lib
    LOGDIR (unset)
    PATH=/home/mjd/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11/bin:/usr/games:/sbin:/usr/sbin:/usr/local/bin/X11:/usr/local/bin/mh:/data/mysql/bin:/usr/local/bin/pbm:/usr/local/bin/ezmlm:/home/mjd/TPI/bin:/usr/local/teTeX/bin:/usr/local/mysql/bin:.
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Aug 29, 2001

From @schwern

That's odd. I get 16 for this one. Not that it's any less wrong.

@p5pRT
Copy link
Author

p5pRT commented Aug 29, 2001

From @mjdominus

Me too. I must have made a paste error.

@p5pRT
Copy link
Author

p5pRT commented Aug 29, 2001

From @tamias

    perl \-le 'eval "\#line 12 xyz\\n1/0;"; print $@​'
    Illegal division by zero at xyz line 12\.

This is correct.

    perl \-le 'eval "\#line 12 xyz\\n1/0"; print $@​'
    Illegal division by zero at xyz line 13\.

This wrong. It should report the error at line 12, not at
line 13.

This issue is independent of eval​:

perl -le '#line 12 xyz' -e '1/0' -e '' -e '' -e '' -e ''
Illegal division by zero at xyz line 16.

Apparently perl reports the error occuring on the line where the statement
ends.

(Tested with 5.005_03.)

Ronald

@p5pRT
Copy link
Author

p5pRT commented Aug 30, 2001

From [Unknown Contact. See original ticket]

We have a look-ahead grammar - unless one tags the tokens that start the
expression then use that in the error messages then "current line" is going to be at the point that byacc
does the "reduce".

@p5pRT
Copy link
Author

p5pRT commented Jun 8, 2005

From @mjdominus

Not worth fixing, in my opinion.

@p5pRT p5pRT closed this as completed Jun 8, 2005
@p5pRT
Copy link
Author

p5pRT commented Jun 8, 2005

@mjdominus - Status changed from 'open' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant