Skip to content

Commit bacb1eb

Browse files
Add CAIRO_DEBUG_SIERRA_GEN env var..
1 parent 44eed82 commit bacb1eb

File tree

1 file changed

+10
-1
lines changed
  • crates/cairo-lang-compiler/src

1 file changed

+10
-1
lines changed

crates/cairo-lang-compiler/src/db.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,17 @@ impl ExternalCodeSizeEstimator for RootDatabase {
4646
// probably too large for inline so we can just return the max size.
4747
return Ok(isize::MAX);
4848
}
49+
if std::env::var("CAIRO_DEBUG_SIERRA_GEN").is_ok() {
50+
// If we are debugging sierra generation, we want to finish the compilation
51+
// rather than panic.
52+
return Ok(isize::MAX);
53+
}
4954

50-
panic!("Failed to compile program to casm.");
55+
panic!(
56+
"Internal compiler error: Failed to compile program to casm. You can set the \
57+
CAIRO_DEBUG_SIERRA_GEN environment if you want to finish the compilation and \
58+
debug the sierra program."
59+
);
5160
}
5261
};
5362
let casm = builder.casm_program();

0 commit comments

Comments
 (0)