Sfoglia il codice sorgente

Merge pull request #73 from SummerGGift/void_bug

【修复】IAR 编译时 void* 指针运算出错的错误
朱天龙 (Armink) 6 anni fa
parent
commit
8ef3560e70
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      port/gccollect.c

+ 1 - 1
port/gccollect.c

@@ -36,7 +36,7 @@ void gc_collect(void) {
     mp_thread_gc_others();
 #else
     // gc the main thread stack
-    gc_collect_root(rt_thread_self()->stack_addr, ((mp_uint_t)((void *)MP_STATE_THREAD(stack_top) - rt_thread_self()->stack_addr)) / 4);
+    gc_collect_root(rt_thread_self()->stack_addr, ((mp_uint_t)MP_STATE_THREAD(stack_top) - (mp_uint_t)rt_thread_self()->stack_addr) / 4);
 #endif
 
     gc_collect_end();