summaryrefslogtreecommitdiff
path: root/callingconvention.cpp
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2017-10-03 23:07:48 -0400
committerRusty Wagner <rusty@vector35.com>2017-10-06 17:28:35 -0400
commit95a7be141a07a20b8465981b01116fcafb6b5f41 (patch)
treee64cf2b30fe37eedf67d8d6111f240295992b020 /callingconvention.cpp
parent1c6f11277096534479c958b6d9fc5265d318ca2a (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();
}