Skip to content

Commit

Permalink
Merge pull request #9397 from weirdan/dont-crash-on-empty-jit_buffer_…
Browse files Browse the repository at this point in the history
…size
  • Loading branch information
weirdan authored Feb 25, 2023
2 parents ae4ec68 + 38d1abc commit e028ba4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Psalm/Internal/Fork/PsalmRestarter.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ protected function requiresRestart($default): bool

private static function toBytes(string $value): int
{
if (strlen($value) === 0) {
return 0;
}

$unit = strtolower($value[strlen($value) - 1]);

if (in_array($unit, ['g', 'm', 'k'], true)) {
Expand Down

0 comments on commit e028ba4

Please sign in to comment.