Commit b26def06 authored by matejcik's avatar matejcik Committed by Damien George

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.
parent 2668337f
...@@ -172,7 +172,7 @@ STATIC void code_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { ...@@ -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 }, { &mp_type_type },
.name = MP_QSTR_code, .name = MP_QSTR_code,
.print = code_print, .print = code_print,
...@@ -185,7 +185,7 @@ mp_obj_t mp_obj_new_code(const mp_raw_code_t *rc) { ...@@ -185,7 +185,7 @@ mp_obj_t mp_obj_new_code(const mp_raw_code_t *rc) {
if (o == NULL) { if (o == NULL) {
return MP_OBJ_NULL; return MP_OBJ_NULL;
} }
o->base.type = &mp_type_code; o->base.type = &mp_type_settrace_codeobj;
o->rc = rc; o->rc = rc;
o->dict_locals = mp_locals_get(); // this is a wrong! how to do this properly? o->dict_locals = mp_locals_get(); // this is a wrong! how to do this properly?
o->lnotab = MP_OBJ_NULL; o->lnotab = MP_OBJ_NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment