Skip to content

Commit 8e3ccd9

Browse files
committed
Don't allow values for codegen-units less than 1 (fixes #32191)
1 parent 1a019dc commit 8e3ccd9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc/session/config.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,10 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
10951095
}
10961096
}
10971097

1098+
if cg.codegen_units < 1 {
1099+
early_error(error_format, "Value for codegen units must be a positive nonzero integer");
1100+
}
1101+
10981102
let cg = cg;
10991103

11001104
let sysroot_opt = matches.opt_str("sysroot").map(|m| PathBuf::from(&m));

0 commit comments

Comments
 (0)