summaryrefslogtreecommitdiff
path: root/callingconvention.cpp
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2017-10-03 23:07:48 -0400
committerPeter LaFosse <peter@vector35.com>2018-03-23 17:10:05 -0400
commitceab7825606b37d1dc142f73931660c9600b340d (patch)
treeccdf6ce16485d20e9b71249db7e0c8d57542992a /callingconvention.cpp
parentc7e9bb6b63e96a6cc779f3f1f64556ebe71b9bfb (diff)
Adding support for register stacks in IL (for x87)
Diffstat (limited to 'callingconvention.cpp')
-rw-r--r--callingconvention.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/callingconvention.cpp b/callingconvention.cpp
index 945ba25f..b29d51e2 100644
--- a/callingconvention.cpp
+++ b/callingconvention.cpp
@@ -264,8 +264,16 @@ vector<uint32_t> CallingConvention::GetImplicitlyDefinedRegisters()
}
-RegisterValue CallingConvention::GetIncomingRegisterValue(uint32_t, Function*)
+RegisterValue CallingConvention::GetIncomingRegisterValue(uint32_t reg, Function*)
{
+ uint32_t regStack = GetArchitecture()->GetRegisterStackForRegister(reg);
+ if ((regStack != BN_INVALID_REGISTER) && (reg == GetArchitecture()->GetRegisterStackInfo(regStack).stackTopReg))
+ {
+ RegisterValue value;
+ value.state = ConstantValue;
+ value.value = 0;
+ return value;
+ }
return RegisterValue();
}