summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Include/frameobject.h2
-rw-r--r--Objects/frameobject.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/Include/frameobject.h b/Include/frameobject.h
index 22bdfa9..479664d 100644
--- a/Include/frameobject.h
+++ b/Include/frameobject.h
@@ -41,6 +41,8 @@ typedef struct _frame {
int f_nvalues; /* size of f_valuestack */
int f_nblocks; /* size of f_blockstack */
int f_iblock; /* index in f_blockstack */
+ int f_lasti; /* Last instruction if called */
+ int f_lineno; /* Current line number */
} frameobject;
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index f86b64d..212fbc9 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -38,6 +38,8 @@ static struct memberlist frame_memberlist[] = {
{"f_code", T_OBJECT, OFF(f_code)},
{"f_globals", T_OBJECT, OFF(f_globals)},
{"f_locals", T_OBJECT, OFF(f_locals)},
+ {"f_lasti", T_INT, OFF(f_lasti)},
+ {"f_lineno", T_INT, OFF(f_lineno)},
{NULL} /* Sentinel */
};
@@ -118,6 +120,8 @@ newframeobject(back, code, globals, locals, nvalues, nblocks)
DECREF(f);
f = NULL;
}
+ f->f_lasti = 0;
+ f->f_lineno = -1;
}
return f;
}