This repository was archived by the owner on Jul 19, 2025. It is now read-only.
Commit f281005
committed
PHP Parser: handle INF/NaN nodes
I tracked this back to this constant number in a source file.
It turns out the literal INF constant in a PHP source if fine:
the parser represents constants directly using the identifier, so
it's fine in JSON.
But the constant number is larger than PHP's max number, so it basically
overflows & get represented as INF after parsing.
On the belief that similar code might result in a NaN constant, I'm also
covering that one. This represents both values using constant strings
that are unlikely to actually appear in anyone's source code.1 parent b618b82 commit f281005
File tree
2 files changed
+30
-1
lines changed- spec/cc/engine/analyzers/php
- vendor/php-parser/lib/PhpParser/Serializer
2 files changed
+30
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
59 | 84 | | |
60 | 85 | | |
61 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
| |||
0 commit comments