From 2fcc294cc65eef9b00ea64fc599209cb7b7a72e2 Mon Sep 17 00:00:00 2001 From: zylin Date: Mon, 23 Oct 2017 22:31:18 +0200 Subject: [PATCH] Sometimes at php7 uniqid() return same result as their previous call. Here generates few equal labels wich makes error on eval. Does not know why uniqid() return same values but this is fact and my construction is more correct than previous. No need to call label id generation and use dirty goto :') --- .../BigInteger/Engines/PHP/Reductions/EvalBarrett.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php index f34018f3..2c770c1d 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php @@ -169,14 +169,11 @@ abstract class EvalBarrett extends Base return 'return [];'; } - $label = 'label_' . uniqid(); - $regular = ' $length = count($' . $input . '); if (!$length) { $' . $output . ' = []; - goto ' . $label . '; - } + }else{ $' . $output . ' = array_fill(0, $length + ' . count($arr) . ', 0); $carry = 0;'; @@ -224,9 +221,7 @@ abstract class EvalBarrett extends Base $regular.= '$' . $output. '[++$k] = $carry; $carry = 0;'; - $regular.= '}'; - - $regular.= $label . ':'; + $regular.= '}}'; //if (count($arr) < 2 * self::KARATSUBA_CUTOFF) { //}