Skip to content

Commit 5be9ff1

Browse files
expand allowd cmdline args
1 parent bb66ab1 commit 5be9ff1

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

base/util.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ function julia_cmd(julia=joinpath(Sys.BINDIR, julia_exename()); cpu_target::Unio
245245
push!(addflags, "--pkgimages=no")
246246
else
247247
# If pkgimage is set, malloc_log and code_coverage should not
248-
@assert opts.malloc_log == 0 && opts.code_coverage == 0
248+
@assert opts.malloc_log in (0, 3) && opts.code_coverage in (0, 3)
249249
end
250250
return `$julia -C$cpu_target -J$image_file $addflags`
251251
end

src/init.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,8 @@ JL_DLLEXPORT void julia_init(JL_IMAGE_SEARCH rel)
804804
#endif
805805

806806
if ((jl_options.outputo || jl_options.outputbc || jl_options.outputasm) &&
807-
(jl_options.code_coverage || jl_options.malloc_log)) {
807+
(jl_options.code_coverage == 1 || jl_options.code_coverage == 2 ||
808+
jl_options.malloc_log == 1 || jl_options.malloc_log == 2)) {
808809
jl_error("cannot generate code-coverage or track allocation information while generating a .o, .bc, or .s output file");
809810
}
810811

src/jloptions.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,10 +860,17 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
860860
"This is a bug, please report it.", c);
861861
}
862862
}
863-
if (codecov || malloclog) {
863+
if (codecov == 1 || codecov == 2) {
864864
if (pkgimage_explicit && jl_options.use_pkgimages) {
865865
jl_errorf("julia: Can't use --pkgimages=yes together "
866-
"with --track-allocation or --code-coverage.");
866+
"with --code-coverage=user|all");
867+
}
868+
jl_options.use_pkgimages = 0;
869+
}
870+
if (malloclog == 1 || malloclog == 2) {
871+
if (pkgimage_explicit && jl_options.use_pkgimages) {
872+
jl_errorf("julia: Can't use --pkgimages=yes together "
873+
"with --track-allocation=user|all");
867874
}
868875
jl_options.use_pkgimages = 0;
869876
}

0 commit comments

Comments
 (0)