Skip to content

Commit b1ebc55

Browse files
committed
Correctly handle missing CG_CLIF_JIT_ARGS
1 parent 88d1068 commit b1ebc55

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/config.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,13 @@ impl Default for BackendConfig {
6464
BackendConfig {
6565
codegen_mode: CodegenMode::Aot,
6666
jit_args: {
67-
let args = std::env::var("CG_CLIF_JIT_ARGS").unwrap_or_else(|_| String::new());
68-
args.split(' ').map(|arg| arg.to_string()).collect()
67+
match std::env::var("CG_CLIF_JIT_ARGS") {
68+
Ok(args) => args.split(' ').map(|arg| arg.to_string()).collect(),
69+
Err(std::env::VarError::NotPresent) => vec![],
70+
Err(std::env::VarError::NotUnicode(s)) => {
71+
panic!("CG_CLIF_JIT_ARGS not unicode: {:?}", s);
72+
}
73+
}
6974
},
7075
enable_verifier: cfg!(debug_assertions) || bool_env_var("CG_CLIF_ENABLE_VERIFIER"),
7176
disable_incr_cache: bool_env_var("CG_CLIF_DISABLE_INCR_CACHE"),

0 commit comments

Comments
 (0)