Skip to content

Commit

Permalink
Fix lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
rickwebiii committed Jul 27, 2023
1 parent 65df198 commit 1dcfdaa
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion benchmarks/bfv_zkp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ark-poly = "0.4.0-alpha.4"
crypto-bigint = "0.4.9"
rand = "0.8.5"
rand_distr = "0.4.3"
sunscreen = { path = "../../sunscreen" }
sunscreen = { path = "../../sunscreen", features = ["debugger"] }
sunscreen_zkp_backend = { path = "../../sunscreen_zkp_backend" }

[dev-dependencies]
Expand Down
10 changes: 5 additions & 5 deletions sunscreen/tests/fhe_program_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,19 +642,19 @@ fn can_collect_multiple_outputs() {
"stack_id": 1 },
{ "operation": "InputCiphertext",
"group_id": 0,
"stack_id": 2 },
"stack_id": 1 },
{ "operation": "Multiply",
"group_id": 0,
"stack_id": 3 },
"stack_id": 2 },
{ "operation": "Add",
"group_id": 0,
"stack_id": 4 },
"stack_id": 3 },
{ "operation": "Output",
"group_id": 0,
"stack_id": 5 },
"stack_id": 4 },
{ "operation": "Output",
"group_id": 0,
"stack_id": 5 },
"stack_id": 4 },
],
"node_holes": [],
"edge_property": "directed",
Expand Down
27 changes: 20 additions & 7 deletions sunscreen_compiler_common/src/lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,31 @@ impl StackFrameInfo {
pub fn new(frame: &BacktraceFrame) -> Self {
let frame_symbols = frame.symbols();
let ip_as_bytes = (frame.ip() as usize).to_ne_bytes();

StackFrameInfo {
callee_name: frame_symbols[0]
.name()
callee_name: frame_symbols
.iter()
.nth(0)
.map(|x| x.name().unwrap_or(SymbolName::new(&ip_as_bytes)))
.unwrap_or(SymbolName::new(&ip_as_bytes))
.to_string(),
callee_file: frame_symbols[0]
.filename()
.unwrap_or(Path::new("No such file"))
callee_file: frame_symbols
.iter()
.nth(0)
.map(|x| x.filename().unwrap_or(Path::new("")))
.unwrap_or(Path::new(""))
.to_string_lossy()
.into_owned(),
callee_lineno: frame_symbols[0].lineno().unwrap_or(0),
callee_col: frame_symbols[0].colno().unwrap_or(0),
callee_lineno: frame_symbols
.iter()
.nth(0)
.map(|x| x.lineno().unwrap_or(0))
.unwrap_or(0),
callee_col: frame_symbols
.iter()
.nth(0)
.map(|x| x.colno().unwrap_or(0))
.unwrap_or(0),
}
}

Expand Down

0 comments on commit 1dcfdaa

Please sign in to comment.