mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
Fixed an assert() exposed by fuzzing. Now, instead of assert when an invalid
instruction encoding is encountered, we just return a NULL ARMBasicMCBuilder instance and the client just returns false to indicate disassembly error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101201 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -3257,6 +3257,9 @@ ARMBasicMCBuilder::ARMBasicMCBuilder(unsigned opc, ARMFormat format,
|
||||
/// are responsible for freeing up of the allocated memory. Cacheing can be
|
||||
/// performed by the API clients to improve performance.
|
||||
ARMBasicMCBuilder *llvm::CreateMCBuilder(unsigned Opcode, ARMFormat Format) {
|
||||
// For "Unknown format", fail by returning a NULL pointer.
|
||||
if ((unsigned)Format >= (array_lengthof(FuncPtrs) - 1))
|
||||
return 0;
|
||||
|
||||
return new ARMBasicMCBuilder(Opcode, Format,
|
||||
ARMInsts[Opcode].getNumOperands());
|
||||
|
Reference in New Issue
Block a user