Exemple #1
0
PyObject* Python_RTN_InsTail(PyObject* self, PyObject* args) {
    PyObject* rtn;
    PyArg_ParseTuple(args, "L", &rtn);
    RTN rtn_object = *(RTN*) rtn;
    INS* ins_return = (INS*) malloc(sizeof(INS));
    *ins_return = RTN_InsTail(rtn_object);
    return Py_BuildValue("L", ins_return);
}
Exemple #2
0
VOID Rtn(RTN rtn, VOID * v)
{
    RTN_Open(rtn);
    UINT32 insNum2 = 0;
    RTN_Close(rtn);// The rtn is intentionally closed and then it is opened again.
                   // This is done in order to check the correctness of both
                   // "RTN_NumIns" and "RTN_InsTail" independently.
                
    UINT32 insNum1 = RTN_NumIns(rtn);
    RTN_Open(rtn);
    for (INS ins = RTN_InsTail(rtn); INS_Valid(ins); ins = INS_Prev(ins)) {
        insNum2++;
    }
    TEST(insNum1 == insNum2, "RTN_NumIns failed");
    RTN_Close(rtn);
}
Exemple #3
0
int rtn_ins_tail (lua_State *L) {
  RTN* v1 = check_rtn(L,1);
  INS_to_lua(L, RTN_InsTail(*v1));
  return 1;
}