Skip to content
  • Yuta Saito's avatar
    0e59d91e
    [wasm] Avoid malloc during longjmp · 0e59d91e
    Yuta Saito authored
    `longjmp` can be called to raise `NoMemoryError` or to trigger GC when
    `malloc` fails to allocate memory in `ruby_xmalloc` family. In such
    case, `malloc` call in `longjmp` will fail again, and Asyncify unwinding
    operation corrupts the memory space by using the failed pointer as
    Asyncify buffer. This commit uses statically allocated buffer to avoid
    such situation.
    0e59d91e
    [wasm] Avoid malloc during longjmp
    Yuta Saito authored
    `longjmp` can be called to raise `NoMemoryError` or to trigger GC when
    `malloc` fails to allocate memory in `ruby_xmalloc` family. In such
    case, `malloc` call in `longjmp` will fail again, and Asyncify unwinding
    operation corrupts the memory space by using the failed pointer as
    Asyncify buffer. This commit uses statically allocated buffer to avoid
    such situation.
Loading