mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +00:00
Fix handling of 'free' if it has absolutely no prototype
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7721 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4c08840e4b
commit
1f28e8ce4d
@ -93,6 +93,13 @@ bool RaiseAllocations::doInitialization(Module &M) {
|
||||
FreeFunc = M.getFunction("free", FreeType);
|
||||
}
|
||||
|
||||
// One last try, check to see if we can find free as 'int (...)* free'. This
|
||||
// handles the case where NOTHING was declared.
|
||||
if (FreeFunc == 0) {
|
||||
FreeType = FunctionType::get(Type::IntTy, std::vector<const Type*>(),true);
|
||||
FreeFunc = M.getFunction("free", FreeType);
|
||||
}
|
||||
|
||||
|
||||
// Don't mess with locally defined versions of these functions...
|
||||
if (MallocFunc && !MallocFunc->isExternal()) MallocFunc = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user