Perl-Critic / PPI

53 stars 44 forks source link

PPI::Token::Number::Exp, Infinite Loop Due To Stringified '00' Exponent #229

Closed wbraswell closed 5 years ago

wbraswell commented 5 years ago

The following input tokens all result in a hang due to infinite loop in PPI::Token::Number::Exp::literal():

1e00 1e+00 1e-00 1e00000

This failure is caused by a string-type $exponent variable containing '00' or '00000' etc, which evaluates as true in the for() loop and never completes, causing the system to hang.

wbraswell commented 5 years ago

This bug appears to affect Perl 5.24 and newer only, at least according to Travis tests.

Failing before bug fix: https://travis-ci.org/wbraswell/physicsperl/builds/443499150

Passing after bug fix: https://travis-ci.org/wbraswell/physicsperl/builds/444291472

wbraswell commented 5 years ago

@wchristian Now passing, thanks! https://travis-ci.org/wbraswell/physicsperl/builds/525135506