If nonGC mode then StructType has also a negative code type of anyref.

This commit is contained in:
Volker Berlin 2019-09-07 19:52:10 +02:00
parent 425e14c6b6
commit 7c2d276de2
2 changed files with 2 additions and 2 deletions

View File

@ -121,7 +121,7 @@ class WasmOutputStream extends FilterOutputStream {
* if an I/O error occurs. * if an I/O error occurs.
*/ */
public void writeDefaultValue( AnyType type ) throws IOException { public void writeDefaultValue( AnyType type ) throws IOException {
if( type.getCode() < 0 ) { if( type instanceof ValueType ) {
ValueType valueType = (ValueType)type; ValueType valueType = (ValueType)type;
switch( valueType ) { switch( valueType ) {
case i32: case i32:

View File

@ -479,7 +479,7 @@ public class TextModuleWriter extends ModuleWriter {
* if an I/O error occurs. * if an I/O error occurs.
*/ */
private static void writeDefaultValue( Appendable output, AnyType type ) throws IOException { private static void writeDefaultValue( Appendable output, AnyType type ) throws IOException {
if( type.getCode() < 0 ) { if( type instanceof ValueType ) {
ValueType valueType = (ValueType)type; ValueType valueType = (ValueType)type;
switch( valueType ) { switch( valueType ) {
case i32: case i32: