summaryrefslogtreecommitdiff
path: root/src/binary-reader-logging.cc
diff options
context:
space:
mode:
authorBen Smith <binji@chromium.org>2020-02-28 20:42:39 -0800
committerGitHub <noreply@github.com>2020-02-28 20:42:39 -0800
commit7914f5f0182b5282d9de8399ba3ff264b5b5dea5 (patch)
tree308294028978a3c438895017fa8f4770ba9b831f /src/binary-reader-logging.cc
parent2d5bdb4a3a1bf8541dda300ffc2d35ffd9d4f84b (diff)
downloadwabt-7914f5f0182b5282d9de8399ba3ff264b5b5dea5.tar.gz
wabt-7914f5f0182b5282d9de8399ba3ff264b5b5dea5.tar.bz2
wabt-7914f5f0182b5282d9de8399ba3ff264b5b5dea5.zip
Update testsuite (w/ reference-types changes) (#1351)
The new table-sub test, checks whether the subtyping is handled properly w/ table.init and table.copy instructions. The BeginElemSegment callback can't pass the element type anymore, since it's not known yet. The callback also can't be deferred, since the BeginElemSegmentInitExpr callback has to happen after the BeginElemSegment callback, but the reference type is not always known until after the initializer expression is read. To work around this, I added a new OnElemSegmentElemType callback. Other element segment changes: * The element type must be tracked in the SharedValidator * A subtle fix: when writing out the segment flags, we need to take into account whether the element type of the segment is not funcref, even if there are no element expressions. In that case, we have to use flag bit 0x4 (SegUseElemExprs). In addition, the TableCopy and TableInit instructions weren't handling table indexes fully. * TableCopy variables are read in the parser (both optional) * TableCopy names are now resolved + applied * TableCopy indexes are now validated * TableInit table variables are read in the parser; this is subtle, since the text format has order $table $segment, but the $table is optional.
Diffstat (limited to 'src/binary-reader-logging.cc')
-rw-r--r--src/binary-reader-logging.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/binary-reader-logging.cc b/src/binary-reader-logging.cc
index 5ee062ed..81ddfbe9 100644
--- a/src/binary-reader-logging.cc
+++ b/src/binary-reader-logging.cc
@@ -368,12 +368,17 @@ Result BinaryReaderLogging::OnSimdShuffleOpExpr(Opcode opcode, v128 value) {
Result BinaryReaderLogging::BeginElemSegment(Index index,
Index table_index,
- uint8_t flags,
- Type elem_type) {
+ uint8_t flags) {
LOGF("BeginElemSegment(index: %" PRIindex ", table_index: %" PRIindex
- ", flags: %d, elem_type: %s)\n",
- index, table_index, flags, GetTypeName(elem_type));
- return reader_->BeginElemSegment(index, table_index, flags, elem_type);
+ ", flags: %d)\n",
+ index, table_index, flags);
+ return reader_->BeginElemSegment(index, table_index, flags);
+}
+
+Result BinaryReaderLogging::OnElemSegmentElemType(Index index, Type elem_type) {
+ LOGF("OnElemSegmentElemType(index: %" PRIindex ", type: %s)\n", index,
+ GetTypeName(elem_type));
+ return reader_->OnElemSegmentElemType(index, elem_type);
}
Result BinaryReaderLogging::OnDataSegmentData(Index index,