Skip to content

Commit 5e0d27a

Browse files
committed
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.
1 parent de0f192 commit 5e0d27a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

eval_error.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,10 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA
169169
write_warn(str, "\n");
170170
}
171171
else {
172+
/* emesg is a String instance */
172173
const char *tail = 0;
173174

174-
if (emesg == Qundef && highlight) write_warn(str, bold);
175+
if (highlight) write_warn(str, bold);
175176
if (RSTRING_PTR(epath)[0] == '#')
176177
epath = 0;
177178
if ((tail = memchr(einfo, '\n', elen)) != 0) {

0 commit comments

Comments
 (0)