File tree Expand file tree Collapse file tree 3 files changed +34
-3
lines changed Expand file tree Collapse file tree 3 files changed +34
-3
lines changed Original file line number Diff line number Diff line change 118
118
'remove-unused-types-exact.wast' ,
119
119
'coalesce-locals-exact.wast' ,
120
120
'remove-unused-brs-exact.wast' ,
121
+ 'signature-refining-exact.wast' ,
121
122
# TODO: fuzzer support for custom descriptors
122
123
'custom-descriptors.wast' ,
123
124
]
Original file line number Diff line number Diff line change @@ -346,9 +346,8 @@ Type GlobalTypeRewriter::getTempType(Type type) {
346
346
if (type.isRef ()) {
347
347
auto heapType = type.getHeapType ();
348
348
if (auto it = typeIndices.find (heapType); it != typeIndices.end ()) {
349
- // TODO: Handle exactness.
350
- return typeBuilder.getTempRefType (typeBuilder[it->second ],
351
- type.getNullability ());
349
+ return typeBuilder.getTempRefType (
350
+ typeBuilder[it->second ], type.getNullability (), type.getExactness ());
352
351
}
353
352
// This type is not one that is eligible for optimizing. That is fine; just
354
353
// use it unmodified.
Original file line number Diff line number Diff line change
1
+ ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
2
+ ;; RUN: wasm-opt %s --signature-refining -all -S -o - | filecheck %s
3
+
4
+ ;; Check that we can refine signatures to contain exact references correctly.
5
+
6
+ (module
7
+ ;; CHECK: (rec
8
+ ;; CHECK-NEXT: (type $f (func))
9
+ (type $f (func ))
10
+
11
+ ;; CHECK: (type $1 (func (param (ref null (exact $f))) (result (ref null (exact $f)))))
12
+
13
+ ;; CHECK: (func $foo (type $1) (param $0 (ref null (exact $f))) (result (ref null (exact $f)))
14
+ ;; CHECK-NEXT: (local $1 (ref null (exact $f)))
15
+ ;; CHECK-NEXT: (drop
16
+ ;; CHECK-NEXT: (call $foo
17
+ ;; CHECK-NEXT: (local.get $1)
18
+ ;; CHECK-NEXT: )
19
+ ;; CHECK-NEXT: )
20
+ ;; CHECK-NEXT: (local.get $1)
21
+ ;; CHECK-NEXT: )
22
+ (func $foo (param funcref ) (result funcref )
23
+ (local (ref null (exact $f )))
24
+ (drop
25
+ (call $foo
26
+ (local.get 1 )
27
+ )
28
+ )
29
+ (local.get 1 )
30
+ )
31
+ )
You can’t perform that action at this time.
0 commit comments