mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
fix function count in table declaration
This commit is contained in:
parent
c410adc636
commit
6da4a93918
@ -77,8 +77,6 @@ public class TextModuleWriter extends ModuleWriter {
|
|||||||
|
|
||||||
private boolean useExceptions;
|
private boolean useExceptions;
|
||||||
|
|
||||||
private int functionCount;
|
|
||||||
|
|
||||||
private boolean callIndirect;
|
private boolean callIndirect;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -114,7 +112,7 @@ public class TextModuleWriter extends ModuleWriter {
|
|||||||
output.append( methodOutput );
|
output.append( methodOutput );
|
||||||
|
|
||||||
if( callIndirect ) {
|
if( callIndirect ) {
|
||||||
int count = functionCount;
|
int count = functions.size();
|
||||||
String countStr = Integer.toString( count );
|
String countStr = Integer.toString( count );
|
||||||
newline( output );
|
newline( output );
|
||||||
output.append( "(table " ).append( countStr ).append( ' ' ).append( countStr ).append( " anyfunc)" );
|
output.append( "(table " ).append( countStr ).append( ' ' ).append( countStr ).append( " anyfunc)" );
|
||||||
@ -270,7 +268,6 @@ public class TextModuleWriter extends ModuleWriter {
|
|||||||
protected void writeMethodParamStart( @Nonnull FunctionName name ) throws IOException {
|
protected void writeMethodParamStart( @Nonnull FunctionName name ) throws IOException {
|
||||||
typeOutput.setLength( 0 );
|
typeOutput.setLength( 0 );
|
||||||
methodParamNames.clear();
|
methodParamNames.clear();
|
||||||
functionCount++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user