summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatejcik <ja@matejcik.cz>2021-04-09 15:28:14 +0200
committerDamien George <damien@micropython.org>2021-04-12 22:31:42 +1000
commitb26def0644b7f4c01cf616a24b6fe18f0737ebb6 (patch)
tree6dbd5d73bd2f34e9be188d981c2c4c8b92555e6d
parent2668337f36deef7fdd97f35e2efc68a5d2102192 (diff)
py/profile: Resolve name collision with STATIC unset.
When building with STATIC undefined (e.g., -DSTATIC=), there are two instances of mp_type_code that collide at link time: in profile.c and in builtinevex.c. This patch resolves the collision by renaming one of them.
-rw-r--r--py/profile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/profile.c b/py/profile.c
index 863b0068a..9cf8c4b7b 100644
--- a/py/profile.c
+++ b/py/profile.c
@@ -172,7 +172,7 @@ STATIC void code_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
}
}
-const mp_obj_type_t mp_type_code = {
+const mp_obj_type_t mp_type_settrace_codeobj = {
{ &mp_type_type },
.name = MP_QSTR_code,
.print = code_print,
@@ -185,7 +185,7 @@ mp_obj_t mp_obj_new_code(const mp_raw_code_t *rc) {
if (o == NULL) {
return MP_OBJ_NULL;
}
- o->base.type = &mp_type_code;
+ o->base.type = &mp_type_settrace_codeobj;
o->rc = rc;
o->dict_locals = mp_locals_get(); // this is a wrong! how to do this properly?
o->lnotab = MP_OBJ_NULL;