mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
Does not write an empty section
This commit is contained in:
parent
940195cdf0
commit
984cfb2bc5
@ -116,8 +116,12 @@ class WasmOutputStream extends FilterOutputStream {
|
||||
*/
|
||||
void writeSection( SectionType type, WasmOutputStream data, String name ) throws IOException {
|
||||
ByteArrayOutputStream baos = (ByteArrayOutputStream)data.out;
|
||||
int size = baos.size();
|
||||
if( size == 0 ) {
|
||||
return;
|
||||
}
|
||||
writeVaruint32( type.ordinal() );
|
||||
writeVaruint32( baos.size() );
|
||||
writeVaruint32( size );
|
||||
if( type == SectionType.Custom ) {
|
||||
byte[] bytes = name.getBytes( StandardCharsets.ISO_8859_1 );
|
||||
writeVaruint32( bytes.length );
|
||||
|
Loading…
x
Reference in New Issue
Block a user