Commit 47195f1
authored
Model constraints on StringNew children more precisely (#7193)
The stringref spec has a bug where the string.new... instructions that
take array reference parameters do not have the proper type annotations,
which means IRBuilder does not have a single type that it knows the
array reference must have. We previously fudged this by using `arrayref`
as the type constraint, but the fuzzer was able to generate a valid test
case that was parsed into invalid IR due to this imprecision.
Fix the bug by adding special constraint types for "any i8 array
reference" and "any i16 array reference" just for use with the offending
string.new instructions.
Fixes #7191.1 parent 8d0f662 commit 47195f1
File tree
3 files changed
+326
-19
lines changed- src
- ir
- wasm
- test/lit/basic
3 files changed
+326
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
94 | 106 | | |
95 | 107 | | |
96 | 108 | | |
| |||
992 | 1004 | | |
993 | 1005 | | |
994 | 1006 | | |
995 | | - | |
996 | | - | |
| 1007 | + | |
997 | 1008 | | |
998 | 1009 | | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
999 | 1014 | | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
| 1015 | + | |
1004 | 1016 | | |
1005 | 1017 | | |
1006 | 1018 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
296 | 305 | | |
297 | 306 | | |
298 | 307 | | |
| |||
301 | 310 | | |
302 | 311 | | |
303 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
304 | 319 | | |
305 | 320 | | |
306 | 321 | | |
| |||
356 | 371 | | |
357 | 372 | | |
358 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
359 | 382 | | |
360 | 383 | | |
361 | 384 | | |
| |||
455 | 478 | | |
456 | 479 | | |
457 | 480 | | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
458 | 501 | | |
459 | 502 | | |
460 | 503 | | |
| |||
601 | 644 | | |
602 | 645 | | |
603 | 646 | | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | 647 | | |
612 | 648 | | |
613 | 649 | | |
| |||
1951 | 1987 | | |
1952 | 1988 | | |
1953 | 1989 | | |
1954 | | - | |
1955 | | - | |
1956 | | - | |
1957 | | - | |
1958 | | - | |
| 1990 | + | |
1959 | 1991 | | |
1960 | 1992 | | |
1961 | 1993 | | |
| |||
0 commit comments