Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

[spec/interpreter/test] Relax ref check to whole module #90

Merged
merged 2 commits into from
May 13, 2020
Merged

Conversation

rossberg
Copy link
Member

Resolves #76, as discussed in CG meeting.

@rossberg rossberg requested a review from binji May 13, 2020 10:23
(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))
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

@rossberg rossberg May 13, 2020

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.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, good point.

Copy link
Member

@binji binji left a 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))
Copy link
Member

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.

@rossberg rossberg merged commit b728bbc into master May 13, 2020
@binji binji deleted the ref-check branch May 13, 2020 18:34
rossberg pushed a commit that referenced this pull request May 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Global function references require two-pass analysis
3 participants