|
From: <wjh...@us...> - 2007-01-30 09:49:54
|
Update of /cvsroot/desquirr/desquirr In directory sc8-pr-cvs12.sourceforge.net:/tmp/cvs-serv17849 Modified Files: usedefine.cpp Log Message: for arm use R0-R3 as function parameters Index: usedefine.cpp =================================================================== RCS file: /cvsroot/desquirr/desquirr/usedefine.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- usedefine.cpp 15 Oct 2005 23:56:03 -0000 1.2 +++ usedefine.cpp 30 Jan 2007 09:49:50 -0000 1.3 @@ -22,6 +22,7 @@ // $Id$ #include "usedefine.hpp" #include "node.hpp" +#include "idapro.hpp" #include "instruction.hpp" #include "expression.hpp" @@ -108,7 +109,23 @@ Define(instruction, 0); } - Use(instruction, 1); + if (instruction.Operand(1)->IsType(Expression::CALL)) { + if (!static_cast<IdaPro&>(Frontend::Get()).ParametersOnStack()) { + CallExpression* call= static_cast<CallExpression*>(instruction.Operand(1).get()); + if (call->ParameterCount()==CallExpression::UNKNOWN_PARAMETER_COUNT) + call->ParameterCount(4); + int i= 0; + while (i < 4 && i < call->ParameterCount()) { + call->AddParameter( Register::Create(i) ); + i++; + } + } + Use(instruction, 1); + Define(instruction, 1); + } + else { + Use(instruction, 1); + } EndInstruction(instruction); } |