Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure add_incoming allocates the proper length memory #37

Merged
merged 1 commit into from
Feb 10, 2021

Commits on Feb 10, 2021

  1. fix: ensure add_incoming allocates the proper length memory

    Without this fix, valgrind reports for zero-length blocks:
    
    ==149294== Invalid write of size 4
    ==149294==    at 0x408121: add_incoming (ujit_core.c:173)
    ==149294==    by 0x408121: gen_block_version (ujit_core.c:286)
    ==149294==    by 0x40873C: gen_entry_point (ujit_core.c:303)
    ==149294==    by 0x3609DF: rb_ujit_compile_iseq (ujit_iface.c:319)
    ==149294==    by 0x33BD2F: mjit_exec (mjit.h:158)
    ==149294==    by 0x33BD2F: rb_vm_exec (vm.c:2167)
    ...
    ==149294==  Address 0x11278850 is 0 bytes inside a block of size 1 alloc'd
    ==149294==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==149294==    by 0x40811B: add_incoming (ujit_core.c:171)
    ==149294==    by 0x40811B: gen_block_version (ujit_core.c:286)
    ==149294==    by 0x40873C: gen_entry_point (ujit_core.c:303)
    ==149294==    by 0x3609DF: rb_ujit_compile_iseq (ujit_iface.c:319)
    ==149294==    by 0x33BD2F: mjit_exec (mjit.h:158)
    ==149294==    by 0x33BD2F: rb_vm_exec (vm.c:2167)
    flavorjones committed Feb 10, 2021
    Configuration menu
    Copy the full SHA
    be5c657 View commit details
    Browse the repository at this point in the history