summaryrefslogtreecommitdiff
path: root/function.cpp
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2018-08-30 22:11:22 -0400
committerRusty Wagner <rusty@vector35.com>2018-08-30 22:11:22 -0400
commitacf28440dc4e8d805a057b6271a73e0d4e8c9e4f (patch)
treeba61688a1dddbce6d66735c538e4204621fc0498 /function.cpp
parent20e06506a3d96c7327ca5d729ab01e8c2a7cff3c (diff)
Allow negative stack offsets for functions like alloca_probe
Diffstat (limited to 'function.cpp')
-rw-r--r--function.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/function.cpp b/function.cpp
index 35fe4123..167a6285 100644
--- a/function.cpp
+++ b/function.cpp
@@ -538,10 +538,10 @@ Confidence<bool> Function::HasVariableArguments() const
}
-Confidence<size_t> Function::GetStackAdjustment() const
+Confidence<int64_t> Function::GetStackAdjustment() const
{
- BNSizeWithConfidence sc = BNGetFunctionStackAdjustment(m_object);
- return Confidence<size_t>(sc.value, sc.confidence);
+ BNOffsetWithConfidence oc = BNGetFunctionStackAdjustment(m_object);
+ return Confidence<int64_t>(oc.value, oc.confidence);
}
@@ -643,12 +643,12 @@ void Function::SetAutoCanReturn(const Confidence<bool>& returns)
}
-void Function::SetAutoStackAdjustment(const Confidence<size_t>& stackAdjust)
+void Function::SetAutoStackAdjustment(const Confidence<int64_t>& stackAdjust)
{
- BNSizeWithConfidence sc;
- sc.value = stackAdjust.GetValue();
- sc.confidence = stackAdjust.GetConfidence();
- BNSetAutoFunctionStackAdjustment(m_object, &sc);
+ BNOffsetWithConfidence oc;
+ oc.value = stackAdjust.GetValue();
+ oc.confidence = stackAdjust.GetConfidence();
+ BNSetAutoFunctionStackAdjustment(m_object, &oc);
}
@@ -757,12 +757,12 @@ void Function::SetCanReturn(const Confidence<bool>& returns)
}
-void Function::SetStackAdjustment(const Confidence<size_t>& stackAdjust)
+void Function::SetStackAdjustment(const Confidence<int64_t>& stackAdjust)
{
- BNSizeWithConfidence sc;
- sc.value = stackAdjust.GetValue();
- sc.confidence = stackAdjust.GetConfidence();
- BNSetUserFunctionStackAdjustment(m_object, &sc);
+ BNOffsetWithConfidence oc;
+ oc.value = stackAdjust.GetValue();
+ oc.confidence = stackAdjust.GetConfidence();
+ BNSetUserFunctionStackAdjustment(m_object, &oc);
}
@@ -1026,7 +1026,7 @@ vector<IndirectBranchInfo> Function::GetIndirectBranchesAt(Architecture* arch, u
}
-void Function::SetAutoCallStackAdjustment(Architecture* arch, uint64_t addr, const Confidence<size_t>& adjust)
+void Function::SetAutoCallStackAdjustment(Architecture* arch, uint64_t addr, const Confidence<int64_t>& adjust)
{
BNSetAutoCallStackAdjustment(m_object, arch->GetObject(), addr, adjust.GetValue(), adjust.GetConfidence());
}
@@ -1057,7 +1057,7 @@ void Function::SetAutoCallRegisterStackAdjustment(Architecture* arch, uint64_t a
}
-void Function::SetUserCallStackAdjustment(Architecture* arch, uint64_t addr, const Confidence<size_t>& adjust)
+void Function::SetUserCallStackAdjustment(Architecture* arch, uint64_t addr, const Confidence<int64_t>& adjust)
{
BNSetUserCallStackAdjustment(m_object, arch->GetObject(), addr, adjust.GetValue(), adjust.GetConfidence());
}
@@ -1088,10 +1088,10 @@ void Function::SetUserCallRegisterStackAdjustment(Architecture* arch, uint64_t a
}
-Confidence<size_t> Function::GetCallStackAdjustment(Architecture* arch, uint64_t addr)
+Confidence<int64_t> Function::GetCallStackAdjustment(Architecture* arch, uint64_t addr)
{
- BNSizeWithConfidence result = BNGetCallStackAdjustment(m_object, arch->GetObject(), addr);
- return Confidence<size_t>(result.value, result.confidence);
+ BNOffsetWithConfidence result = BNGetCallStackAdjustment(m_object, arch->GetObject(), addr);
+ return Confidence<int64_t>(result.value, result.confidence);
}