InvalidUsernameException
9d81c71aef
Do not mis-parse certain wide-character emojis as integer
...
When calling ch_to_digit() with a UTF-16 or UTF-32 code unit, it simply
truncates away any data stored in the non-low byte(s) of the code unit.
It then uses a lookup table to determine whether the low byte
corresponds to an ASCII digit. This is incorrect because as soon as any
bit outside the low byte is set, the number will never correspond to a
ASCII digit anymore.
To fix this, we produce a mask that is all zeroes if any bit outside the
low byte is set in the code unit, all ones otherwise. Anding this mask
with the original code unit forces the table lookup to return the
sentinel value from the zero-index if any high bit was set and causes
the code unit not to be parsed as integer.
This bug was discovered when loading Mastodon posts inside the Ladybird
browser where some of Mastodon's JavaScript would trigger the code path
that erroneously parsed the emoji as integer. It had the visible effect
that some digits inside the posts would get rendered as one of the
emojis that parsed to that digit. For more details see this issue:
https://github.com/LadybirdBrowser/ladybird/issues/6205
The emojis in the test case are simply all the emojis used on Mastodon
that caused the bug. They can be found here:
06803422da/app/javascript/mastodon/features/emoji/emoji_map.json
2025-09-15 23:12:28 +02:00
Daniel Lemire
fec4082f01
Merge pull request #322 from leiwen2025/rv-support
...
float_common.h: Support RISC-V
2025-09-12 15:11:45 -04:00
Daniel Lemire
e89e248bd7
Update risc.yml
2025-09-11 22:14:59 -04:00
Daniel Lemire
96fc38fb5a
adding risc ci
2025-09-11 22:11:05 -04:00
WenLei
6677924083
float_common.h: Support RISC-V
2025-09-11 11:11:30 +08:00
Pavel Novikov
0a230326ab
now finally got the anti-ambiguity overloads right, right?
2025-09-06 02:22:43 +03:00
Pavel Novikov
7ae62ee0d5
finally got the anti-ambiguity overloads right?
2025-09-06 02:10:55 +03:00
Daniel Lemire
4bb6fd1271
Merge pull request #314 from fastfloat/P2497R0
...
implementation of p2497
2025-09-05 18:24:48 -04:00
Pavel Novikov
e12463583f
added lacking overloads to avoid potential ambiguity
2025-09-06 00:12:41 +03:00
Pavel Novikov
6702cd4244
added doc section in the README,
...
added example code test executable
2025-09-05 13:36:23 +03:00
Pavel Novikov
20a7383442
renamed the function, cleaned up return type
2025-09-05 13:36:23 +03:00
Pavel Novikov
763558b9ac
cleaned up tests
2025-09-05 13:34:48 +03:00
Daniel Lemire
ce511cb9ee
Merge pull request #317 from fastfloat/dependabot/github_actions/github-actions-a331d3ec2d
...
Bump actions/checkout from 4 to 5 in the github-actions group
2025-09-03 12:07:06 -04:00
Daniel Lemire
42db9ac1de
Merge branch 'main' into P2497R0
2025-09-03 12:04:36 -04:00
Pavel Novikov
6be07d66a8
inlining Clinger's fast path because why not,
...
and it seems to bring performance to the level before the changes somewhat
2025-09-03 16:59:40 +03:00
dependabot[bot]
42836b48eb
Bump actions/checkout from 4 to 5 in the github-actions group
...
Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout ).
Updates `actions/checkout` from 4 to 5
- [Release notes](https://github.com/actions/checkout/releases )
- [Commits](https://github.com/actions/checkout/compare/v4...v5 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-version: '5'
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: github-actions
...
Signed-off-by: dependabot[bot] <support@github.com>
2025-09-02 21:31:49 +00:00
Daniel Lemire
a9ac1b40c9
Merge pull request #316 from fastfloat/emscripten
...
adding emscripten build test
2025-09-02 17:29:37 -04:00
Daniel Lemire
c0582c27f5
typos in the comments
2025-09-02 17:29:12 -04:00
Pavel Novikov
cc90f240ee
added some tests
2025-09-02 23:03:38 +03:00
Pavel Novikov
a134561e4b
added missing inline specifiers
2025-09-02 23:03:38 +03:00
Pavel Novikov
7b8f04500a
implemented multiplication of integer by power of 10
2025-09-02 13:20:36 +03:00
HedgehogInTheCPP
cd3118d722
Merge pull request #2 from IRainman/dependabot/github_actions/github-actions-a331d3ec2d
...
Bump actions/checkout from 4 to 5 in the github-actions group
2025-08-27 08:12:41 +03:00
HedgehogInTheCPP
41dc71fa9e
Merge branch 'fastfloat:main' into main
2025-08-27 07:58:52 +03:00
Daniel Lemire
0a9257e825
Merge pull request #318 from SirLynix/patch-1
...
README: Add xmake repository reference
2025-08-25 09:27:45 -04:00
Jérôme Leclercq
e1c2c806ed
README: Add xmake repository reference
2025-08-25 13:42:53 +02:00
dependabot[bot]
0cdbf36d78
Bump actions/checkout from 4 to 5 in the github-actions group
...
Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout ).
Updates `actions/checkout` from 4 to 5
- [Release notes](https://github.com/actions/checkout/releases )
- [Commits](https://github.com/actions/checkout/compare/v4...v5 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-version: '5'
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: github-actions
...
Signed-off-by: dependabot[bot] <support@github.com>
2025-08-18 04:14:24 +00:00
IRainman
acdcd0438f
Merge branch 'main' of https://github.com/fastfloat/fast_float
2025-06-14 22:53:06 +03:00
Daniel Lemire
6b10835aa9
update
2025-06-04 21:14:09 -04:00
Daniel Lemire
3d09138b1b
trimming
2025-06-04 20:45:56 -04:00
Daniel Lemire
3ee7eb018d
updating CI
2025-06-03 18:19:33 -04:00
Daniel Lemire
2d2b42bb38
forked doctest
2025-06-03 18:15:52 -04:00
Daniel Lemire
73b27b7d68
hmmm
2025-06-02 09:52:34 -04:00
Daniel Lemire
fbc85aa706
adding cmake policy for doctest
2025-06-02 09:25:42 -04:00
Daniel Lemire
5a4b793818
adding emscripten build test
2025-06-02 09:15:06 -04:00
Daniel Lemire
e5d93c993e
updating workflow
2025-05-19 18:32:56 -04:00
Daniel Lemire
a1e272f515
lint
2025-05-19 18:16:14 -04:00
Daniel Lemire
447ee0bc82
updating documentation
2025-05-19 18:12:35 -04:00
Daniel Lemire
0458c20061
adding missing file
2025-05-19 18:09:34 -04:00
Daniel Lemire
81b8306c5f
implementation of https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2497r0.html
2025-05-19 18:08:36 -04:00
Daniel Lemire
b8085ba363
Update README.md
2025-05-19 11:55:15 -04:00
IRainman
a72afb539f
unfck clang format
2025-05-12 16:45:40 +03:00
IRainman
42131710b7
compilation fix for internal tests
2025-05-12 15:28:42 +03:00
IRainman
5ae2fba79d
cleanup for parse_number_string
2025-05-10 19:59:22 +03:00
IRainman
437a80ccfd
fix for type usage in parse_int_string
2025-05-08 18:19:45 +03:00
IRainman
978441a5bb
additional FASTFLOAT_HAS_BIT_CAST improve for older standards.
2025-05-07 23:19:18 +03:00
IRainman
a550415314
additional fix for bfloat16_t. Sorry, I can't compile it's locally.
2025-05-07 22:55:48 +03:00
IRainman
7bac32408e
fix for the parse_number_string
2025-05-07 22:14:55 +03:00
IRainman
f14d482767
fix for the parse_number_string
2025-05-07 21:59:53 +03:00
IRainman
88fff01513
fix for the parse_number_string
2025-05-07 21:51:43 +03:00
IRainman
3ee80c2da3
fix for the parse_number_string
2025-05-07 21:43:26 +03:00