From f466fc5c09019ab0266ab3e12a0b9cf81d0e19c4 Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Fri, 19 Apr 2019 20:33:33 +0200 Subject: [PATCH] Correct the coding of Struct like the spec https://github.com/lars-t-hansen/moz-gc-experiments/blob/master/version2.md --- src/de/inetsoftware/jwebassembly/binary/StructTypeEntry.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/de/inetsoftware/jwebassembly/binary/StructTypeEntry.java b/src/de/inetsoftware/jwebassembly/binary/StructTypeEntry.java index c69b6d9..a2ef514 100644 --- a/src/de/inetsoftware/jwebassembly/binary/StructTypeEntry.java +++ b/src/de/inetsoftware/jwebassembly/binary/StructTypeEntry.java @@ -59,6 +59,9 @@ class StructTypeEntry extends TypeEntry { stream.writeVaruint32( this.fields.size() ); for( NamedStorageType field : this.fields ) { stream.writeVarint( 1 ); // 0 - immutable; 1 - mutable + if( field.type.getCode() > 0 ) { + stream.writeVaruint32( 0x6E ); + } stream.writeValueType( field.type ); } }