summaryrefslogtreecommitdiff
path: root/lib/assembler.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/assembler.c')
-rw-r--r--lib/assembler.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/assembler.c b/lib/assembler.c
index 6c5d3a8..0055680 100644
--- a/lib/assembler.c
+++ b/lib/assembler.c
@@ -70,6 +70,7 @@ int s_text = 0, s_data = 0, s_bss = 0;
static void debug_print_expression(expression_t * e)
{
+ if (!e) return;
switch (e->e_subtype) {
case E_OPERATION:
switch (e->op) {
@@ -1478,8 +1479,10 @@ void asm_eol(void)
fprintf(stderr, "Fin de ligne sur:\n");
debug_print_expression(e_line);
fprintf(stderr, "-----\n");
-
+
e_current = e_line;
+ if (!(e_current)) break;
+
/* Est-ce que le premier mot est un label terminant par ':' ? */
if (e_current->e_subtype == E_LABEL) {
if (e_current->symbol[strlen(e_current->symbol) - 1] == ':') {
@@ -1572,6 +1575,7 @@ void asm_eol(void)
}
break;
case E_INSTRUCT:
+ if (!e_current) break;
if (segment != SEG_TEXT) {
exception(1, _("You can only have an instruction into a .text segment"));
}
@@ -1747,7 +1751,7 @@ void assemble_file(char * iname, char * oname) {
exception(1, _("Error writing output file"));
}
popcontext();
- if (!process_file(iname)) {
+ if (process_file(iname)) {
exception(1, _("Error reading file"));
}
pushcontext(_("Writing output file"));