Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround arm64 opcache bug (fixes #9350) #9351

Merged
merged 3 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -84,10 +84,10 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
ini-values: zend.assertions=1, assert.exception=1
ini-values: zend.assertions=1, assert.exception=1, opcache.enable_cli=1, opcache.jit=function, opcache.jit_buffer_size=512M
tools: composer:v2
coverage: none
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, opcache, openssl, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter

- uses: actions/checkout@v3

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-ci.yml
Expand Up @@ -55,10 +55,10 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
ini-values: zend.assertions=1, assert.exception=1
ini-values: zend.assertions=1, assert.exception=1, opcache.enable_cli=1, opcache.jit=function, opcache.jit_buffer_size=512M
tools: composer:v2
coverage: none
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, opcache, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter

- uses: actions/checkout@v3

Expand Down
Expand Up @@ -2,6 +2,7 @@

namespace Psalm\Internal\Analyzer\Statements\Expression\BinaryOp;

use AssertionError;
use PhpParser;
use Psalm\CodeLocation;
use Psalm\Config;
Expand Down Expand Up @@ -41,7 +42,6 @@
use Psalm\Type\Union;
use UnexpectedValueException;

use function assert;
use function count;
use function reset;
use function strlen;
Expand Down Expand Up @@ -178,8 +178,12 @@ public static function analyze(
}

if ($literal_concat) {
assert(count($result_type_parts) === $combinations);
assert(count($result_type_parts) !== 0); // #8163
if (count($result_type_parts) === 0) {
throw new AssertionError("The number of parts cannot be 0!");
}
if (count($result_type_parts) !== $combinations) {
throw new AssertionError("The number of parts does not match!");
}
$result_type = new Union($result_type_parts);
}
}
Expand Down