Skip to content

Commit 756d35e

Browse files
committed
Avoid usage of jl_error() in check_cmdline()
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
1 parent 23a5b04 commit 756d35e

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/processor.cpp

+12-8
Original file line numberDiff line numberDiff line change
@@ -822,20 +822,24 @@ static inline void check_cmdline(T &&cmdline, bool imaging)
822822
// sysimg means. Make it an error for now.
823823
if (!imaging) {
824824
if (cmdline.size() > 1) {
825-
jl_error("More than one command line CPU targets specified "
826-
"without a `--output-` flag specified");
825+
jl_safe_printf("More than one command line CPU targets specified "
826+
"without a `--output-` flag specified");
827+
exit(1);
827828
}
828829
if (cmdline[0].en.flags & JL_TARGET_CLONE_ALL) {
829-
jl_error("\"clone_all\" feature specified "
830-
"without a `--output-` flag specified");
830+
jl_safe_printf("\"clone_all\" feature specified "
831+
"without a `--output-` flag specified");
832+
exit(1);
831833
}
832834
if (cmdline[0].en.flags & JL_TARGET_OPTSIZE) {
833-
jl_error("\"opt_size\" feature specified "
834-
"without a `--output-` flag specified");
835+
jl_safe_printf("\"opt_size\" feature specified "
836+
"without a `--output-` flag specified");
837+
exit(1);
835838
}
836839
if (cmdline[0].en.flags & JL_TARGET_MINSIZE) {
837-
jl_error("\"min_size\" feature specified "
838-
"without a `--output-` flag specified");
840+
jl_safe_printf("\"min_size\" feature specified "
841+
"without a `--output-` flag specified");
842+
exit(1);
839843
}
840844
}
841845
}

0 commit comments

Comments
 (0)