Commit 6b2e1ef
committed
Merge pull request #5888 from Cellule:users/micfer/leb128
When reading the last byte of a LEB128, the additional unused bits should be all zeros (or can be all ones if signed LEB128).
For instance, when reading a uint32, you need to read 5 bytes with 7 bits used per bytes that's 35 bits, so there are 3 bits that needs to be checked.
This doesn't change anything in practice other than spec compliance.
I took the opportunity to simplify the LEB128 decoding code
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/microsoft/chakracore/5888)
<!-- Reviewable:end -->
File tree
2 files changed
+43
-32
lines changed- lib/WasmReader
- test/WasmSpec/baselines/testsuite/core
2 files changed
+43
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1247 | 1247 | | |
1248 | 1248 | | |
1249 | 1249 | | |
1250 | | - | |
| 1250 | + | |
1251 | 1251 | | |
1252 | | - | |
1253 | | - | |
| 1252 | + | |
| 1253 | + | |
1254 | 1254 | | |
1255 | | - | |
| 1255 | + | |
| 1256 | + | |
1256 | 1257 | | |
1257 | 1258 | | |
1258 | 1259 | | |
1259 | | - | |
1260 | 1260 | | |
1261 | | - | |
1262 | | - | |
1263 | | - | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
| 1261 | + | |
1273 | 1262 | | |
1274 | 1263 | | |
1275 | | - | |
| 1264 | + | |
1276 | 1265 | | |
1277 | 1266 | | |
1278 | 1267 | | |
1279 | 1268 | | |
1280 | | - | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
1281 | 1298 | | |
1282 | | - | |
1283 | | - | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
1284 | 1305 | | |
1285 | 1306 | | |
1286 | 1307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 1 | + | |
0 commit comments