Camelcade/Devel-Camelcadedb

Infinite loop when keyword 'each' used in while condition

mominshahab opened this issue · 3 comments

When the following code is run in the debugger , line by line, it gets stuck in infinite loop. The code runs fine without debugger.

my %hash = ('Hello' => 'World');
while ( my ( $key, $value ) = each %hash ) {
    print "\n$key=$value";
}

The code above can be used to reproduce the issue.

Perl version: 5.18.2 built for MSWin32-x86-multi-thread-64int
Deval::Camelcadedb version: 1.6.1.2
InteliJ IDEA version 2016.1.3
Perl Plugin version 2.005

Seems something resets %hash iterator when it steps inside the debugger. I've disabled suspected methods in it but it didn't helped. Will need to investigate. For now you may use alternatives way of iteration.

Upd, aside of keys and vals, copying hash via %other_hash = %hash resets iterator too :(

You may checkout this repo and run perl Makefile.PL && make install or dmake if you are on windows. Should work fine now. Thank you for reporting this issue.