-
Notifications
You must be signed in to change notification settings - Fork 836
Fix import checking when table's runtime size changes #8222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,9 @@ | |
|
|
||
| namespace wasm { | ||
|
|
||
| // Traps on out of bounds access | ||
| // Runtime representation of a table for interpreting use cases e.g. | ||
| // wasm-interpreter.h. Effectively a vector of Literal. Throws TrapException on | ||
| // out-of-bounds access. | ||
| class RuntimeTable { | ||
| public: | ||
| RuntimeTable(Table table) : tableMeta_(table) {} | ||
|
|
@@ -41,7 +43,15 @@ class RuntimeTable { | |
|
|
||
| virtual std::size_t size() const = 0; | ||
|
|
||
| virtual const Table* tableMeta() const { return &tableMeta_; } | ||
| // True iff this is a subtype of the definition `other`. i.e. This table can | ||
| // be imported with the definition of `other` | ||
| virtual bool isSubType(const Table& other) { | ||
| return tableMeta_.addressType == other.addressType && | ||
| Type::isSubType(tableMeta_.type, other.type) && | ||
| size() >= other.initial && tableMeta_.max <= other.max; | ||
| } | ||
|
|
||
| const Table* tableMeta() const { return &tableMeta_; } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does "meta" mean here? Could this be
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I meant it like 'metadata', I didn't want to name this table since this class is also a table. I think the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, yeah, maybe
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good, I put it in the next PR if that sounds good #8230 |
||
|
|
||
| protected: | ||
| const Table tableMeta_; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.