diff options
author | Damien George <damien.p.george@gmail.com> | 2014-08-24 16:28:17 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-08-24 16:28:17 +0100 |
commit | 3c658a4e755a75e495303957208486e583ddb270 (patch) | |
tree | 6418fea9bf3dcf4aed2145db94fda4c0de1d0321 /py/asmthumb.c | |
parent | 25fc41dd316c38df3e2a6cfe4b53322d76dc92fc (diff) | |
download | micropython-3c658a4e755a75e495303957208486e583ddb270.tar.gz micropython-3c658a4e755a75e495303957208486e583ddb270.zip |
py: Fix bug where GC collected native/viper/asm function data.
Because (for Thumb) a function pointer has the LSB set, pointers to
dynamic functions in RAM (eg native, viper or asm functions) were not
being traced by the GC. This patch is a comprehensive fix for this.
Addresses issue #820.
Diffstat (limited to 'py/asmthumb.c')
-rw-r--r-- | py/asmthumb.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/py/asmthumb.c b/py/asmthumb.c index 75ce168f73..1102bb74ab 100644 --- a/py/asmthumb.c +++ b/py/asmthumb.c @@ -132,8 +132,7 @@ uint asm_thumb_get_code_size(asm_thumb_t *as) { } void *asm_thumb_get_code(asm_thumb_t *as) { - // need to set low bit to indicate that it's thumb code - return (void *)(((mp_uint_t)as->code_base) | 1); + return as->code_base; } /* |