|
425 | 425 | (func $func (type $func)
|
426 | 426 | )
|
427 | 427 | )
|
| 428 | + |
| 429 | +;; Regression test for an assertion failure on packed data reads from null |
| 430 | +;; references. |
| 431 | +(module |
| 432 | + (type $i8 (struct (field i8))) |
| 433 | + |
| 434 | + ;; NRML: (type $0 (func (param (ref none)) (result i32))) |
| 435 | + |
| 436 | + ;; NRML: (table $0 1 funcref) |
| 437 | + ;; GUFA: (type $0 (func (param (ref none)) (result i32))) |
| 438 | + |
| 439 | + ;; GUFA: (table $0 1 funcref) |
| 440 | + ;; O3O3: (type $0 (func (param (ref none)) (result i32))) |
| 441 | + |
| 442 | + ;; O3O3: (table $0 1 funcref) |
| 443 | + (table $0 1 funcref) |
| 444 | + ;; NRML: (elem $0 (i32.const 0) $test) |
| 445 | + ;; GUFA: (elem $0 (i32.const 0) $test) |
| 446 | + ;; O3O3: (elem $0 (i32.const 0) $test) |
| 447 | + (elem $0 (i32.const 0) $test) |
| 448 | + |
| 449 | + ;; NRML: (export "table" (table $0)) |
| 450 | + ;; GUFA: (export "table" (table $0)) |
| 451 | + ;; O3O3: (export "table" (table $0)) |
| 452 | + (export "table" (table $0)) |
| 453 | + |
| 454 | + ;; NRML: (func $test (type $0) (param $i8 (ref none)) (result i32) |
| 455 | + ;; NRML-NEXT: (block ;; (replaces unreachable StructGet we can't emit) |
| 456 | + ;; NRML-NEXT: (drop |
| 457 | + ;; NRML-NEXT: (local.get $i8) |
| 458 | + ;; NRML-NEXT: ) |
| 459 | + ;; NRML-NEXT: (unreachable) |
| 460 | + ;; NRML-NEXT: ) |
| 461 | + ;; NRML-NEXT: ) |
| 462 | + ;; GUFA: (func $test (type $0) (param $i8 (ref none)) (result i32) |
| 463 | + ;; GUFA-NEXT: (block ;; (replaces unreachable StructGet we can't emit) |
| 464 | + ;; GUFA-NEXT: (drop |
| 465 | + ;; GUFA-NEXT: (local.get $i8) |
| 466 | + ;; GUFA-NEXT: ) |
| 467 | + ;; GUFA-NEXT: (unreachable) |
| 468 | + ;; GUFA-NEXT: ) |
| 469 | + ;; GUFA-NEXT: ) |
| 470 | + ;; O3O3: (func $test (type $0) (param $0 (ref none)) (result i32) |
| 471 | + ;; O3O3-NEXT: (unreachable) |
| 472 | + ;; O3O3-NEXT: ) |
| 473 | + (func $test (param $i8 (ref none)) (result i32) |
| 474 | + (struct.get_s $i8 0 |
| 475 | + (local.get $i8) |
| 476 | + ) |
| 477 | + ) |
| 478 | +) |
0 commit comments