diff options
| author | Alan Wu <XrXr@users.noreply.github.com> | 2024-02-01 15:55:49 -0500 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-02-01 22:04:46 +0000 |
| commit | 770b5499a550956001b879abb5bbd205eabda19f (patch) | |
| tree | c27ac78df081f52a99128c918120c52348329dca /prism | |
| parent | 4fbdbde0887d038c679b9e0369234d1061441232 (diff) | |
[ruby/prism] Amend assert in pm_utf_8_codepoint(), n=0 is fine
This assert used to trip in the included test:
```
./miniruby --parser=prism -e ' "%W"\u" '
```
https://github.com/ruby/prism/commit/8c0f84db4f
Diffstat (limited to 'prism')
| -rw-r--r-- | prism/encoding.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/prism/encoding.c b/prism/encoding.c index bdb9958e97..c8e0941d1d 100644 --- a/prism/encoding.c +++ b/prism/encoding.c @@ -2252,7 +2252,7 @@ static const uint8_t pm_utf_8_dfa[] = { */ static pm_unicode_codepoint_t pm_utf_8_codepoint(const uint8_t *b, ptrdiff_t n, size_t *width) { - assert(n >= 1); + assert(n >= 0); size_t maximum = (size_t) n; uint32_t codepoint; |
