From 149fe25ee94d47858761726166e32626278fb97a Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 28 Dec 2000 19:53:54 +0000 Subject: [PATCH] * error msg tweak 2000-12-28 Frank Ch. Eigler * cgen-asm.in (parse_insn_normal): Print better error message for instructions with missing operands. --- opcodes/ChangeLog | 5 +++++ opcodes/cgen-asm.in | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index cd9239c28ca..4eda874c6f8 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2000-12-28 Frank Ch. Eigler + + * cgen-asm.in (parse_insn_normal): Print better error message for + instructions with missing operands. + 2000-12-21 Santeri Paavolainen * cgen-opc.c: Include alloca.h if HAVE_ALLOCA_H is defined. diff --git a/opcodes/cgen-asm.in b/opcodes/cgen-asm.in index ad6d1722fab..9915f065b7a 100644 --- a/opcodes/cgen-asm.in +++ b/opcodes/cgen-asm.in @@ -127,7 +127,7 @@ parse_insn_normal (cd, insn, strp, fields) ++ syn; ++ str; } - else + else if (*str) { /* Syntax char didn't match. Can't be this insn. */ static char msg [80]; @@ -136,6 +136,15 @@ parse_insn_normal (cd, insn, strp, fields) *syn, *str); return msg; } + else + { + /* Ran out of input. */ + static char msg [80]; + /* xgettext:c-format */ + sprintf (msg, _("syntax error (expected char `%c', found end of instruction)"), + *syn); + return msg; + } continue; } -- 2.30.2