only set a function index if method is used

This commit is contained in:
Volker Berlin 2020-05-02 15:31:26 +02:00
parent 4b581dd969
commit ee5b3ce326

View File

@ -494,7 +494,9 @@ public class TypeManager {
// if a new needed method then add it // if a new needed method then add it
methods.add( funcName ); methods.add( funcName );
} }
functions.setFunctionIndex( funcName, idx + VTABLE_FIRST_FUNCTION_INDEX ); if( idx < methods.size() ) {
functions.setFunctionIndex( funcName, idx + VTABLE_FIRST_FUNCTION_INDEX );
}
} }
} }
@ -564,7 +566,10 @@ public class TypeManager {
* @param getFunctionsID * @param getFunctionsID
* source for function IDs * source for function IDs
* @throws IOException * @throws IOException
* should never occur * should never occur
* @see TypeManager#TYPE_DESCRIPTION_INTERFACE_OFFSET
* @see TypeManager#TYPE_DESCRIPTION_INSTANCEOF_OFFSET
* @see TypeManager#TYPE_DESCRIPTION_TYPE_NAME
*/ */
public void writeToStream( ByteArrayOutputStream dataStream, ToIntFunction<FunctionName> getFunctionsID ) throws IOException { public void writeToStream( ByteArrayOutputStream dataStream, ToIntFunction<FunctionName> getFunctionsID ) throws IOException {
/* /*