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
rossberg merged 2 commits into
masterfrom
ref-check
May 13, 2020
Merged

rossberg merged 2 commits into
masterfrom
ref-check

Conversation

@rossberg

Copy link
Copy Markdown
Member

Resolves #76, as discussed in CG meeting.

@rossberg
rossberg requested a review from binji May 13, 2020 10:23
Comment thread test/core/ref_func.wast
(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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 May 13, 2020 •

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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.

@binji binji left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

Comment thread test/core/ref_func.wast
(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
Copy Markdown
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