From 46ad17cf1097e3fd84c8adaefd60d3bb4f5f10a3 Mon Sep 17 00:00:00 2001 From: Dobin Rutishauser Date: Thu, 13 Jun 2024 08:50:31 +0200 Subject: [PATCH] fix: make masm_shc errors exceptions --- phases/masmshc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phases/masmshc.py b/phases/masmshc.py index 35a393b..6c9aeed 100644 --- a/phases/masmshc.py +++ b/phases/masmshc.py @@ -100,7 +100,7 @@ def masm_shc(asm_text_lines: List[str]) -> str: g_is32bit = True if tokens[0] == "EXTRN": - print(f"[ERROR] Line {line_count + 1}: External dependency detected:\n{line}") + raise Exception(f"[ERROR] Line {line_count + 1}: External dependency detected:\n{line}") in_skipped = False in_const = False @@ -127,7 +127,7 @@ def masm_shc(asm_text_lines: List[str]) -> str: logger.debug("[INFO] Entry Point: AlignRSP") if seg_name == "_BSS": - logger.error(f"[ERROR] Line {line_count + 1}: _BSS segment detected! Remove all global and static variables!\n") + raise Exception(f"[ERROR] Line {line_count + 1}: _BSS segment detected! Remove all global and static variables!\n") if seg_name in ("pdata", "xdata", "voltbl"): in_skipped = True @@ -145,7 +145,7 @@ def masm_shc(asm_text_lines: List[str]) -> str: if tokens[1] in ("LIBCMT", "OLDNAMES"): ofile.write(f"; {line}\n") # copy commented out line continue - print(f"[ERROR] Line {line_count + 1}: INCLUDELIB detected! Remove all external dependencies!\n") + raise Exception(f"[ERROR] Line {line_count + 1}: INCLUDELIB detected! Remove all external dependencies!\n") if params.inline_strings and in_const: if tokens[1] == "DB":