From acf28440dc4e8d805a057b6271a73e0d4e8c9e4f Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Thu, 30 Aug 2018 22:11:22 -0400 Subject: Allow negative stack offsets for functions like alloca_probe --- function.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'function.cpp') diff --git a/function.cpp b/function.cpp index 35fe4123..167a6285 100644 --- a/function.cpp +++ b/function.cpp @@ -538,10 +538,10 @@ Confidence Function::HasVariableArguments() const } -Confidence Function::GetStackAdjustment() const +Confidence Function::GetStackAdjustment() const { - BNSizeWithConfidence sc = BNGetFunctionStackAdjustment(m_object); - return Confidence(sc.value, sc.confidence); + BNOffsetWithConfidence oc = BNGetFunctionStackAdjustment(m_object); + return Confidence(oc.value, oc.confidence); } @@ -643,12 +643,12 @@ void Function::SetAutoCanReturn(const Confidence& returns) } -void Function::SetAutoStackAdjustment(const Confidence& stackAdjust) +void Function::SetAutoStackAdjustment(const Confidence& 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& returns) } -void Function::SetStackAdjustment(const Confidence& stackAdjust) +void Function::SetStackAdjustment(const Confidence& 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 Function::GetIndirectBranchesAt(Architecture* arch, u } -void Function::SetAutoCallStackAdjustment(Architecture* arch, uint64_t addr, const Confidence& adjust) +void Function::SetAutoCallStackAdjustment(Architecture* arch, uint64_t addr, const Confidence& 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& adjust) +void Function::SetUserCallStackAdjustment(Architecture* arch, uint64_t addr, const Confidence& adjust) { BNSetUserCallStackAdjustment(m_object, arch->GetObject(), addr, adjust.GetValue(), adjust.GetConfidence()); } @@ -1088,10 +1088,10 @@ void Function::SetUserCallRegisterStackAdjustment(Architecture* arch, uint64_t a } -Confidence Function::GetCallStackAdjustment(Architecture* arch, uint64_t addr) +Confidence Function::GetCallStackAdjustment(Architecture* arch, uint64_t addr) { - BNSizeWithConfidence result = BNGetCallStackAdjustment(m_object, arch->GetObject(), addr); - return Confidence(result.value, result.confidence); + BNOffsetWithConfidence result = BNGetCallStackAdjustment(m_object, arch->GetObject(), addr); + return Confidence(result.value, result.confidence); } -- cgit v1.3.1