FEX-Emu / FEX-Emu/FEX

AOTIR: Deleting the RAData inappropriately

Open
#1,654 0 comments 0 reactions 1 assignee Assigned to @skmp View on GitHub
Dominant language
C++
Stars
8k
Forks
351
Avg merge
12h 31m
Merged PRs (30d)
102

Description

https://github.com/FEX-Emu/FEX/blob/42a632093545d0bf74bb1d87e285e58fa18d0aef/External/FEXCore/Source/Interface/IR/AOTIR.cpp#L353

This is allocated using using FEXCore::Allocator::malloc, then it tries to get freed with C++ delete.
https://github.com/FEX-Emu/FEX/blob/42a632093545d0bf74bb1d87e285e58fa18d0aef/External/FEXCore/Source/Interface/IR/Passes/RegisterAllocationPass.cpp#L156

This is why when allocating it we have it in a unique_ptr with a custom deleter, but the code is just wrong here.
`std::unique_ptr AllocData;`

This causes LLVM asan to just immediately barf.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.