Commit 0143482
Fix AllowTrailingInvalidCharacters parsing edge cases
- Reset elementsConsumed to 0 on the integer and decimal overflow paths so a
failed parse never reports a nonzero consumed count.
- Restrict floating-point special-value (Infinity/NaN) matching to the non-hex
path and honor AllowTrailingInvalidCharacters via prefix matching, reporting
leading whitespace plus the matched symbol as consumed.
- Apply the same special-value consistency fix to the IEEE-754 decimal path
(Decimal32/64/128) and share the matching logic via a helper.
- Add AllowTrailingInvalidCharacters to the hex and binary allowed styles.
- Remove redundant string null guards from TryParse overloads and rely on
ReadOnlySpan null-tolerance; relax internal asserts to tolerate empty spans.
- Restore the UTF-8 BOM inadvertently stripped from Double/Single and the
IEEE-754 decimal source files.
- Add and correct AllowTrailingInvalidCharacters tests, using
CultureInfo.InvariantCulture for culture-dependent special values.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>1 parent 6f0aa99 commit 0143482
35 files changed
Lines changed: 609 additions & 334 deletions
File tree
- src/libraries
- Common/src/System
- System.Private.CoreLib/src/System
- Numerics
- System.Runtime.Numerics
- src/System
- Numerics
- tests
- BigInteger
- System.Runtime/tests/System.Runtime.Tests/System
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
343 | 345 | | |
344 | 346 | | |
345 | 347 | | |
346 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
347 | 353 | | |
348 | 354 | | |
349 | 355 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | 127 | | |
134 | 128 | | |
135 | 129 | | |
| |||
1108 | 1102 | | |
1109 | 1103 | | |
1110 | 1104 | | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | 1105 | | |
1119 | 1106 | | |
1120 | 1107 | | |
| |||
Lines changed: 0 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | 554 | | |
561 | 555 | | |
562 | 556 | | |
| |||
1785 | 1779 | | |
1786 | 1780 | | |
1787 | 1781 | | |
1788 | | - | |
1789 | | - | |
1790 | | - | |
1791 | | - | |
1792 | | - | |
1793 | | - | |
1794 | | - | |
1795 | 1782 | | |
1796 | 1783 | | |
1797 | 1784 | | |
| |||
Lines changed: 0 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | 430 | | |
437 | 431 | | |
438 | 432 | | |
| |||
1491 | 1485 | | |
1492 | 1486 | | |
1493 | 1487 | | |
1494 | | - | |
1495 | | - | |
1496 | | - | |
1497 | | - | |
1498 | | - | |
1499 | | - | |
1500 | | - | |
1501 | 1488 | | |
1502 | 1489 | | |
1503 | 1490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | 395 | | |
402 | 396 | | |
403 | 397 | | |
| |||
2171 | 2165 | | |
2172 | 2166 | | |
2173 | 2167 | | |
2174 | | - | |
2175 | | - | |
2176 | | - | |
2177 | | - | |
2178 | | - | |
2179 | | - | |
2180 | | - | |
2181 | 2168 | | |
2182 | 2169 | | |
2183 | 2170 | | |
| |||
Lines changed: 0 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | 160 | | |
167 | 161 | | |
168 | 162 | | |
| |||
1919 | 1913 | | |
1920 | 1914 | | |
1921 | 1915 | | |
1922 | | - | |
1923 | | - | |
1924 | | - | |
1925 | | - | |
1926 | | - | |
1927 | | - | |
1928 | | - | |
1929 | 1916 | | |
1930 | 1917 | | |
1931 | 1918 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | 160 | | |
167 | 161 | | |
168 | 162 | | |
| |||
1298 | 1292 | | |
1299 | 1293 | | |
1300 | 1294 | | |
1301 | | - | |
1302 | | - | |
1303 | | - | |
1304 | | - | |
1305 | | - | |
1306 | | - | |
1307 | | - | |
1308 | 1295 | | |
1309 | 1296 | | |
1310 | 1297 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | 176 | | |
183 | 177 | | |
184 | 178 | | |
| |||
1365 | 1359 | | |
1366 | 1360 | | |
1367 | 1361 | | |
1368 | | - | |
1369 | | - | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
1375 | 1362 | | |
1376 | 1363 | | |
1377 | 1364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | 173 | | |
180 | 174 | | |
181 | 175 | | |
| |||
1368 | 1362 | | |
1369 | 1363 | | |
1370 | 1364 | | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
1375 | | - | |
1376 | | - | |
1377 | | - | |
1378 | 1365 | | |
1379 | 1366 | | |
1380 | 1367 | | |
| |||
0 commit comments