Commit fde0aa55 by Enkelmann Committed by Enkelmann

cargo fmt

parent 3c1edf8d
...@@ -246,8 +246,12 @@ impl From<Expression> for IrExpression { ...@@ -246,8 +246,12 @@ impl From<Expression> for IrExpression {
Const(bitvector) => { Const(bitvector) => {
// The internal IR expects everything to be byte-sized, so we have to extend the bitvector if necessary. // The internal IR expects everything to be byte-sized, so we have to extend the bitvector if necessary.
let size: ByteSize = bitvector.width().into(); let size: ByteSize = bitvector.width().into();
IrExpression::Const(bitvector.into_zero_extend(apint::BitWidth::from(size)).unwrap()) IrExpression::Const(
}, bitvector
.into_zero_extend(apint::BitWidth::from(size))
.unwrap(),
)
}
Load { .. } | Store { .. } | Let { .. } => panic!(), Load { .. } | Store { .. } | Let { .. } => panic!(),
IfThenElse { true_exp, .. } => IrExpression::Unknown { IfThenElse { true_exp, .. } => IrExpression::Unknown {
description: "BAP-IfThenElse-expression".into(), description: "BAP-IfThenElse-expression".into(),
......
...@@ -16,7 +16,7 @@ use crate::prelude::*; ...@@ -16,7 +16,7 @@ use crate::prelude::*;
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Hash, Clone)] #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Hash, Clone)]
pub struct Call { pub struct Call {
pub target: Label, pub target: Label,
#[serde(rename="return")] #[serde(rename = "return")]
pub return_: Option<Label>, pub return_: Option<Label>,
} }
...@@ -70,13 +70,15 @@ impl From<Jmp> for IrJmp { ...@@ -70,13 +70,15 @@ impl From<Jmp> for IrJmp {
// i.e. jumping there means jumping to nowhere. // i.e. jumping there means jumping to nowhere.
// Usually the jump ends up jumping to address 0. // Usually the jump ends up jumping to address 0.
IrJmp::CallOther { IrJmp::CallOther {
description: format!("Unresolved jump: Jump to value read from address {}", address), description: format!(
"Unresolved jump: Jump to value read from address {}",
address
),
return_: None, return_: None,
} }
} else { } else {
IrJmp::BranchInd(target.into()) IrJmp::BranchInd(target.into())
} }
} }
CALL => { CALL => {
let call = jmp.call.unwrap(); let call = jmp.call.unwrap();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment