aboutsummaryrefslogtreecommitdiffstats
path: root/eval_error.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-15 16:44:07 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-15 16:49:39 +0900
commit5e0d27a32f2b3f1242c9990acf83b7970b37bbce (patch)
tree740522b5030b6ab4a8e0f6d44a5b8eb979801208 /eval_error.c
parentde0f192444e3822968d04cdea6e868bd42ccfa7f (diff)
downloadruby-5e0d27a32f2b3f1242c9990acf83b7970b37bbce.tar.gz
Removed dead code
If `emesg` is `Qundef`, it is not a message string and then `elen` (the length of the message) is 0. So `emesg` cannot be `Qundef` in the `elen != 0` block. Pointed out by Coverity Scan.
Diffstat (limited to 'eval_error.c')
-rw-r--r--eval_error.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/eval_error.c b/eval_error.c
index b0ee0f45c9..44d82e8a7f 100644
--- a/eval_error.c
+++ b/eval_error.c
@@ -169,9 +169,10 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA
write_warn(str, "\n");
}
else {
+ /* emesg is a String instance */
const char *tail = 0;
- if (emesg == Qundef && highlight) write_warn(str, bold);
+ if (highlight) write_warn(str, bold);
if (RSTRING_PTR(epath)[0] == '#')
epath = 0;
if ((tail = memchr(einfo, '\n', elen)) != 0) {