From: Paul Mooney Date: Thu, 10 Mar 2016 10:50:57 +0000 (+0000) Subject: Avoid infinite loop if save point does not exist X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=50ba8f0da90c7ef0151c8269fbffbda63e35a1db;p=dbsrgits%2FDBIx-Class-Historic.git Avoid infinite loop if save point does not exist --- diff --git a/lib/DBIx/Class/Storage.pm b/lib/DBIx/Class/Storage.pm index 45839e1..4e9cdac 100644 --- a/lib/DBIx/Class/Storage.pm +++ b/lib/DBIx/Class/Storage.pm @@ -433,7 +433,9 @@ sub svp_release { my @stack = @{ $self->savepoints }; my $svp; - do { $svp = pop @stack } until $svp eq $name; + while (@stack and $stack[-1] ne $name) { + $svp = pop @stack + }; $self->throw_exception ("Savepoint '$name' does not exist") unless $svp;