Skip to content

Commit b26def0

Browse files
matejcikdpgeorge
authored andcommitted
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.
1 parent 2668337 commit b26def0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

py/profile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ STATIC void code_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
172172
}
173173
}
174174

175-
const mp_obj_type_t mp_type_code = {
175+
const mp_obj_type_t mp_type_settrace_codeobj = {
176176
{ &mp_type_type },
177177
.name = MP_QSTR_code,
178178
.print = code_print,
@@ -185,7 +185,7 @@ mp_obj_t mp_obj_new_code(const mp_raw_code_t *rc) {
185185
if (o == NULL) {
186186
return MP_OBJ_NULL;
187187
}
188-
o->base.type = &mp_type_code;
188+
o->base.type = &mp_type_settrace_codeobj;
189189
o->rc = rc;
190190
o->dict_locals = mp_locals_get(); // this is a wrong! how to do this properly?
191191
o->lnotab = MP_OBJ_NULL;

0 commit comments

Comments
 (0)