diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index aeaf6ce841899..bbb2fc7ba36fa 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -5188,7 +5188,7 @@ static int zend_jit_long_math_helper(dasm_State **Dst, result_reg = ZREG_R0; } else { /* ASSIGN_DIM_OP */ - if (sizeof(void*) == 4 + if (ZREG_FCARG1 == ZREG_RCX && (opcode == ZEND_SL || opcode == ZEND_SR) && Z_MODE(op2_addr) != IS_CONST_ZVAL) { result_reg = ZREG_R2; diff --git a/ext/opcache/tests/jit/gh11917.phpt b/ext/opcache/tests/jit/gh11917.phpt new file mode 100644 index 0000000000000..a66105d7a8f7a --- /dev/null +++ b/ext/opcache/tests/jit/gh11917.phpt @@ -0,0 +1,61 @@ +--TEST-- +GH-11917: primitives seem to be passed via reference instead of by value under some conditions when JIT is enabled on windows +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +--FILE-- +>= $split; + if (!$overflow) { + $remaining -= $split; + $overflow = $split <= $remaining ? 0 : $split - $remaining; + + if (!$remaining) { + $i++; + $remaining = 31; + $overflow = 0; + } + } elseif (++$i != $len) { + $tempmask = (1 << $overflow) - 1; + $digit |= ($val[$i] & $tempmask) << $remaining; + $val[$i] >>= $overflow; + $remaining = 31 - $overflow; + $overflow = $split <= $remaining ? 0 : $split - $remaining; + } + + $vals[] = $digit; + } + + while ($vals[count($vals) - 1] == 0) { + unset($vals[count($vals) - 1]); + } + + return array_reverse($vals); +} +?> +--EXPECT-- +48207660 +48207660 +48207660 +48207660 diff --git a/ext/pdo_pgsql/tests/gh12423.phpt b/ext/pdo_pgsql/tests/gh12423.phpt index 8e479d3e5da65..cce7c72e2ec14 100644 --- a/ext/pdo_pgsql/tests/gh12423.phpt +++ b/ext/pdo_pgsql/tests/gh12423.phpt @@ -1,10 +1,15 @@ --TEST-- GitHub #12424 (Fix GH-12423: [pdo_pgsql] Changed to prioritize DSN authentication information over arguments.) +--EXTENSIONS-- +pdo +pdo_pgsql --SKIPIF-- --FILE-- @@ -15,21 +20,23 @@ $dsnWithCredentials = $config['ENV']['PDOTEST_DSN']; $user = $config['ENV']['PDOTEST_USER'] ?? null; $password = $config['ENV']['PDOTEST_PASS'] ?? null; if (!$user) { - preg_match('/user=(.*?) /', $dsnWithCredentials, $match); + preg_match('/user=([^ ]*?)/', $dsnWithCredentials, $match); $user = $match[1] ?? ''; } if (!$password) { - preg_match('/password=(.*?)$/', $dsnWithCredentials, $match); + preg_match('/password=([^ ]*?)/', $dsnWithCredentials, $match); $password = $match[1] ?? ''; } -$dsn = str_replace(" user={$user} password={$password}", '', $dsnWithCredentials); +$dsn = str_replace("user={$user}", '', $dsnWithCredentials); +$dsn = str_replace("password={$password}", '', $dsn); +$dsn = rtrim($dsn); echo "dsn without credentials / correct user / correct password\n"; try { $db = new PDO($dsn, $user, $password, [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]); echo "Connected.\n\n"; } catch (PDOException $e) { - echo $e->getMessage(); + echo $e->getMessage()."\n"; } echo "dsn with credentials / no user / no password\n"; @@ -37,7 +44,7 @@ try { $db = new PDO("{$dsn} user={$user} password={$password}", null, null, [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]); echo "Connected.\n\n"; } catch (PDOException $e) { - echo $e->getMessage(); + echo $e->getMessage()."\n"; } echo "dsn with correct user / incorrect user / correct password\n"; @@ -45,7 +52,7 @@ try { $db = new PDO("{$dsn} user={$user}", 'hoge', $password, [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]); echo "Connected.\n\n"; } catch (PDOException $e) { - echo $e->getMessage(); + echo $e->getMessage()."\n"; } echo "dsn with correct password / correct user / incorrect password\n"; @@ -53,7 +60,7 @@ try { $db = new PDO("{$dsn} password={$password}", $user, 'fuga', [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]); echo "Connected.\n\n"; } catch (PDOException $e) { - echo $e->getMessage(); + echo $e->getMessage()."\n"; } echo "dsn with correct credentials / incorrect user / incorrect password\n"; @@ -61,7 +68,7 @@ try { $db = new PDO("{$dsn} user={$user} password={$password}", 'hoge', 'fuga', [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]); echo "Connected.\n"; } catch (PDOException $e) { - echo $e->getMessage(); + echo $e->getMessage()."\n"; } ?> --EXPECT--