Skip to content

Commit

Permalink
Avoid usage of jl_error() in check_cmdline()
Browse files Browse the repository at this point in the history
This is the same as #45765 where
we use `jl_error()` too early to get backtraces, but too late to fail
the supposed guard `if` statement that should prevent us from trying to
take a backtrace.  X-ref: #45847
  • Loading branch information
staticfloat authored and pull[bot] committed Aug 25, 2023
1 parent b022ba6 commit 6e8e50e
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -822,20 +822,24 @@ static inline void check_cmdline(T &&cmdline, bool imaging)
// sysimg means. Make it an error for now.
if (!imaging) {
if (cmdline.size() > 1) {
jl_error("More than one command line CPU targets specified "
"without a `--output-` flag specified");
jl_safe_printf("More than one command line CPU targets specified "
"without a `--output-` flag specified");
exit(1);
}
if (cmdline[0].en.flags & JL_TARGET_CLONE_ALL) {
jl_error("\"clone_all\" feature specified "
"without a `--output-` flag specified");
jl_safe_printf("\"clone_all\" feature specified "
"without a `--output-` flag specified");
exit(1);
}
if (cmdline[0].en.flags & JL_TARGET_OPTSIZE) {
jl_error("\"opt_size\" feature specified "
"without a `--output-` flag specified");
jl_safe_printf("\"opt_size\" feature specified "
"without a `--output-` flag specified");
exit(1);
}
if (cmdline[0].en.flags & JL_TARGET_MINSIZE) {
jl_error("\"min_size\" feature specified "
"without a `--output-` flag specified");
jl_safe_printf("\"min_size\" feature specified "
"without a `--output-` flag specified");
exit(1);
}
}
}
Expand Down

0 comments on commit 6e8e50e

Please sign in to comment.