Commit 1e9e4ab9 by Enkelmann Committed by Enkelmann

implement parsing of CALLOTHER jumps.

parent 1cbdc889
...@@ -18,6 +18,7 @@ pub struct Call { ...@@ -18,6 +18,7 @@ pub struct Call {
pub target: Label, pub target: Label,
#[serde(rename = "return")] #[serde(rename = "return")]
pub return_: Option<Label>, pub return_: Option<Label>,
pub call_string: Option<String>,
} }
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Hash, Clone)] #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Hash, Clone)]
...@@ -36,6 +37,7 @@ pub enum JmpType { ...@@ -36,6 +37,7 @@ pub enum JmpType {
BRANCHIND, BRANCHIND,
CALL, CALL,
CALLIND, CALLIND,
CALLOTHER,
RETURN, RETURN,
} }
...@@ -94,6 +96,13 @@ impl From<Jmp> for IrJmp { ...@@ -94,6 +96,13 @@ impl From<Jmp> for IrJmp {
return_: call.return_.map(unwrap_label_direct), return_: call.return_.map(unwrap_label_direct),
} }
} }
CALLOTHER => {
let call = jmp.call.unwrap();
IrJmp::CallOther {
description: call.call_string.unwrap(),
return_: call.return_.map(unwrap_label_direct),
}
}
RETURN => IrJmp::Return(unwrap_label_indirect(jmp.goto.unwrap()).into()), RETURN => IrJmp::Return(unwrap_label_indirect(jmp.goto.unwrap()).into()),
} }
} }
......
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