summaryrefslogtreecommitdiff
path: root/src/binary-writer.cc
diff options
context:
space:
mode:
authorBen Smith <binji@chromium.org>2020-03-23 18:54:14 -0700
committerGitHub <noreply@github.com>2020-03-23 18:54:14 -0700
commit7898e57f28c89565b99e894e764e058346e28fbe (patch)
tree91d72a1bcef76ecb83f3f550710bee8f9152b8ce /src/binary-writer.cc
parentdc396c9d57d59c33c99f5f6c6c1b8f67de086dc8 (diff)
downloadwabt-7898e57f28c89565b99e894e764e058346e28fbe.tar.gz
wabt-7898e57f28c89565b99e894e764e058346e28fbe.tar.bz2
wabt-7898e57f28c89565b99e894e764e058346e28fbe.zip
Parse ArrayTypes (#1364)
The following formats are supported: * (type (array i32)) * (type (array (field i32))) * (type (array (field (mut i32)))) This PR adds support for reading/writing binary and text, but no interpreter support yet.
Diffstat (limited to 'src/binary-writer.cc')
-rw-r--r--src/binary-writer.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/binary-writer.cc b/src/binary-writer.cc
index bd285599..6c0a73db 100644
--- a/src/binary-writer.cc
+++ b/src/binary-writer.cc
@@ -915,6 +915,15 @@ Result BinaryWriter::WriteModule() {
}
break;
}
+
+ case TypeEntryKind::Array: {
+ const ArrayType* array_type = cast<ArrayType>(type);
+ WriteHeader("array type", i);
+ WriteType(stream_, Type::Array);
+ WriteType(stream_, array_type->field.type);
+ stream_->WriteU8(array_type->field.mutable_, "field mutability");
+ break;
+ }
}
}
EndSection();