Explorar o código

Fix: initialize record_frame in aot_copy_callstack (#4861)

liang.he hai 4 días
pai
achega
f159cc56ac
Modificáronse 2 ficheiros con 4 adicións e 1 borrados
  1. 2 1
      .gitignore
  2. 2 0
      core/iwasm/aot/aot_runtime.c

+ 2 - 1
.gitignore

@@ -1,3 +1,4 @@
+
 .cache
 .clangd
 .vs
@@ -39,4 +40,4 @@ tests/benchmarks/coremark/coremark*
 samples/workload/include/**
 !samples/workload/include/.gitkeep
 
-# core/iwasm/libraries/wasi-threads
+# core/iwasm/libraries/wasi-threads

+ 2 - 0
core/iwasm/aot/aot_runtime.c

@@ -4333,6 +4333,7 @@ aot_copy_callstack_tiny_frame(WASMExecEnv *exec_env, WASMCApiFrame *buffer,
 
     AOTTinyFrame *frame = (AOTTinyFrame *)(top - sizeof(AOTTinyFrame));
     WASMCApiFrame record_frame;
+    memset(&record_frame, 0, sizeof(WASMCApiFrame));
     while (frame && (uint8_t *)frame >= bottom && count < (skip_n + length)) {
         if (count < skip_n) {
             ++count;
@@ -4375,6 +4376,7 @@ aot_copy_callstack_standard_frame(WASMExecEnv *exec_env, WASMCApiFrame *buffer,
     uint32 frame_size = (uint32)offsetof(AOTFrame, lp);
 
     WASMCApiFrame record_frame;
+    memset(&record_frame, 0, sizeof(WASMCApiFrame));
     while (cur_frame && (uint8_t *)cur_frame >= bottom
            && (uint8_t *)cur_frame + frame_size <= top_boundary
            && count < (skip_n + length)) {