mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-04 21:31:03 +00:00
"fix" PR4612, which is a crash on:
%0 = malloc [3758096384 x i32] The "malloc" instruction doesn't support 64-bits correctly (see PR715), and should be removed. Victor is actively working on fixing this, in the meantime just don't crash. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76899 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
17e4aa7d0a
commit
50340f666b
@ -5431,9 +5431,13 @@ void SelectionDAGLowering::visitMalloc(MallocInst &I) {
|
||||
// multiply on 64-bit targets.
|
||||
// FIXME: Malloc inst should go away: PR715.
|
||||
uint64_t ElementSize = TD->getTypeAllocSize(I.getType()->getElementType());
|
||||
if (ElementSize != 1)
|
||||
if (ElementSize != 1) {
|
||||
// Src is always 32-bits, make sure the constant fits.
|
||||
assert(Src.getValueType() == MVT::i32);
|
||||
ElementSize = (uint32_t)ElementSize;
|
||||
Src = DAG.getNode(ISD::MUL, getCurDebugLoc(), Src.getValueType(),
|
||||
Src, DAG.getConstant(ElementSize, Src.getValueType()));
|
||||
}
|
||||
|
||||
MVT IntPtr = TLI.getPointerTy();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user