mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 02:24:22 +00:00
Fix a crash in the LL parser where it failed to validate that the pointer operand of a GEP was valid.
This manifested as an assertion failure in +Asserts builds, and a hard crash in -Asserts builds. Found by fuzzing the LL parser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230934 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -5458,6 +5458,8 @@ int LLParser::ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) {
|
||||
return true;
|
||||
|
||||
Type *PtrTy = Ptr->getType();
|
||||
if (!isa<SequentialType>(PtrTy))
|
||||
return Error(Loc, "pointer type is not valid");
|
||||
if (VectorType *VT = dyn_cast<VectorType>(PtrTy))
|
||||
PtrTy = VT->getElementType();
|
||||
if (Ty != cast<SequentialType>(PtrTy)->getElementType())
|
||||
|
Reference in New Issue
Block a user