-
Notifications
You must be signed in to change notification settings - Fork 0
Exceptions table management
hydrophobis edited this page Mar 25, 2025
·
2 revisions
These functions manage the exceptions table section of the Java class file. The exceptions table describes the exception handlers for different sections of the bytecode.
-
void exceptions_start()
Initializes the exceptions table. Reserves space for theexception_table_lengthand starts the counter for entries. -
void exceptions_end()
Finalizes the exceptions table by patching theexception_table_lengthat the reserved location.
-
void patch_u2(size_t pos, uint16_t v)
Updates a 2-byte value in the buffer (used to finalizeexception_table_length). -
size_t current_offset()
Returns the current offset in the bytecode buffer.
exceptions_start();
exceptions_end();This will generate an exceptions table with two entries.