-
Notifications
You must be signed in to change notification settings - Fork 40
[spec/interpreter/test] Relax ref check to whole module #90
Conversation
(elem (table $t) (i32.const 0) func $f3) | ||
(elem (table $t) (i32.const 0) funcref (ref.func $f4)) | ||
(elem func $f5) | ||
(elem funcref (ref.func $f6)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the function referenced by the start section be included here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent question! I think not, since the start function doesn't escape. I added another special case and test for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true, but neither do non-exported globals and tables. It does seem like a strange omission.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@binji, I suppose you mean the references stored in such globals or tables? Those can still escape after global.get
or table.get
and returning the result to somewhere. I think checking that these can't escape would require inter-procedural flow analysis.
(Put differently, the start function does not produce a first-class reference.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, good point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
(elem (table $t) (i32.const 0) func $f3) | ||
(elem (table $t) (i32.const 0) funcref (ref.func $f4)) | ||
(elem func $f5) | ||
(elem funcref (ref.func $f6)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true, but neither do non-exported globals and tables. It does seem like a strange omission.
This was accidentally omitted.
Resolves #76, as discussed in CG meeting.