Skip to content

Commit db74ff4

Browse files
committed
Sanitize inliner solc setting
1 parent 04bdba6 commit db74ff4

File tree

1 file changed

+9
-2
lines changed
  • crates/artifacts/solc/src

1 file changed

+9
-2
lines changed

crates/artifacts/solc/src/lib.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,14 @@ impl Settings {
314314
self.via_ir = None;
315315
}
316316

317+
const V0_8_5: Version = Version::new(0, 8, 5);
318+
if *version < V0_8_5 {
319+
// introduced in 0.8.5 <https://github.com/ethereum/solidity/releases/tag/v0.8.5>
320+
if let Some(optimizer_details) = &mut self.optimizer.details {
321+
optimizer_details.inliner = None;
322+
}
323+
}
324+
317325
const V0_8_7: Version = Version::new(0, 8, 7);
318326
if *version < V0_8_7 {
319327
// lower the disable version from 0.8.10 to 0.8.7, due to `divModNoSlacks`,
@@ -467,8 +475,7 @@ impl Settings {
467475
self.via_ir = Some(true);
468476
self.optimizer.details = Some(OptimizerDetails {
469477
peephole: Some(false),
470-
// Set to None as it is only supported for solc starting from 0.8.5.
471-
inliner: None,
478+
inliner: Some(false),
472479
jumpdest_remover: Some(false),
473480
order_literals: Some(false),
474481
deduplicate: Some(false),

0 commit comments

Comments
 (0)