Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ void addSectionData(SECTION *section, uint8_t startByte[], uint32_t size) {
* @return The relative position of the bracket, -1 if not found
*/
int get_matching_bracket(INSTRUCTIONS *instructions, int position, bool throwError) {
if (instructions->size <= position)
return -1;

if (instructions->instruction[position].type != '[') {
if (throwError)
fprintf(stderr, "No bracket to match at position %i!\n", position);
Expand Down