fix(wasmtime):Config methods should be idempotent (#4252)
This commit refactored `Config` to use a seperate `CompilerConfig` field instead of operating on `CompilerBuilder` directly to make all its methods idempotent. Fixes #4189
This commit is contained in:
@@ -421,8 +421,7 @@ impl Config {
|
||||
|
||||
if self.wasmtime.force_jump_veneers {
|
||||
unsafe {
|
||||
cfg.cranelift_flag_set("wasmtime_linkopt_force_jump_veneer", "true")
|
||||
.unwrap();
|
||||
cfg.cranelift_flag_set("wasmtime_linkopt_force_jump_veneer", "true");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,8 +430,7 @@ impl Config {
|
||||
cfg.cranelift_flag_set(
|
||||
"wasmtime_linkopt_padding_between_functions",
|
||||
&pad.to_string(),
|
||||
)
|
||||
.unwrap();
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -658,7 +656,7 @@ impl CodegenSettings {
|
||||
config.target(target).unwrap();
|
||||
for (key, value) in flags {
|
||||
unsafe {
|
||||
config.cranelift_flag_set(key, value).unwrap();
|
||||
config.cranelift_flag_set(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user