1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

lex.c: add default, though it should never happen (re: b0282f26)

If a bug is ever introduced that causes a [[ ... ]] operator to be
unhandled by the linter, we should at least avoid writing random
memory contents to standard error. In non-release builds, let's
abort() so the problem can be more easily backtraced.
This commit is contained in:
Martijn Dekker 2021-11-30 21:43:50 +01:00
parent 6904585f49
commit 520f530198

View file

@ -1411,6 +1411,13 @@ breakloop:
case TEST_GE:
alt = ">="; /* '-ge' --> '>=' */
break;
default:
#if _AST_ksh_release
alt = NIL(char*); /* output '(null)' (should never happen) */
#else
abort();
#endif
break;
}
errormsg(SH_DICT, ERROR_warn(0), e_lexobsolete4,
shp->inlineno, state, alt);