mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Add a check to avoid an assertion on malformed input
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16861 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
222b86f694
commit
1c1bb33534
@ -2120,6 +2120,9 @@ MemoryInst : MALLOC Types {
|
|||||||
if (!isa<PointerType>($3->get()))
|
if (!isa<PointerType>($3->get()))
|
||||||
ThrowException("Can't load from nonpointer type: " +
|
ThrowException("Can't load from nonpointer type: " +
|
||||||
(*$3)->getDescription());
|
(*$3)->getDescription());
|
||||||
|
if (!cast<PointerType>($3->get())->getElementType()->isFirstClassType())
|
||||||
|
ThrowException("Can't load from pointer of non-first-class type: " +
|
||||||
|
(*$3)->getDescription());
|
||||||
$$ = new LoadInst(getVal(*$3, $4), "", $1);
|
$$ = new LoadInst(getVal(*$3, $4), "", $1);
|
||||||
delete $3;
|
delete $3;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user