Commit 78defb0
committed
pp_pack: unpack: Use 'uv' form, not 'uvchr'
Like previous commits, this converts a call to utf8n_to_uvchr() to use
instead utf8_to_uv_flags().
And like previous commits, the previous code thought it was checking for
failure and croaking, but was checking the wrong way so that it never
could fail. With the new commit, it can fail.
Also, the previous commit stored the result in an 'int', whose range can
be significantly less than the code point returned. The value was
truncated without notice. Now, I croak if the value got truncated.
This code doesn't fully make sense to me, as this is for unpacking a 'c'
format, which is supposed to be a signed 8-bit value, and what is
getting stored is a full integer value1 parent 9a463d3 commit 78defb0
1 file changed
+14
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1239 | 1239 | | |
1240 | 1240 | | |
1241 | 1241 | | |
1242 | | - | |
1243 | | - | |
1244 | | - | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
1245 | 1254 | | |
| 1255 | + | |
| 1256 | + | |
1246 | 1257 | | |
1247 | 1258 | | |
1248 | 1259 | | |
| |||
0 commit comments