handle the block operator

This commit is contained in:
Volker Berlin 2018-05-03 22:57:44 +02:00
parent 02c76d407e
commit 987d26de64
3 changed files with 10 additions and 0 deletions

View File

@ -635,6 +635,10 @@ public class BinaryModuleWriter extends ModuleWriter implements InstructionOpcod
case DROP:
codeStream.write( DROP );
break;
case BLOCK:
codeStream.write( BLOCK );
codeStream.write( 0x40 ); // void; the return type of the block. currently we does not use it
break;
default:
throw new Error( "Unknown block: " + op );
}

View File

@ -29,4 +29,6 @@ public enum BlockOperator {
END,
GOTO,
DROP,
BLOCK,
SWITCH,
}

View File

@ -271,6 +271,10 @@ public class TextModuleWriter extends ModuleWriter {
case DROP:
name = "drop";
break;
case BLOCK:
name = "block";
insetAfter++;
break;
default:
throw new Error( "Unknown block: " + op );
}