public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* Prevent an abort in the FRV disassembler if the target bfd name is unknown
@ 2017-04-07 10:30 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2017-04-07 10:30 UTC (permalink / raw)
  To: cgen; +Cc: Nick Clifton

This moves one of Nick's patches to where it belongs.  OK to apply?

	PR 20946
	* desc-cpu.scm (lookup_mach_via_bfd_name): Return NULL if the name
	could not be matched.
	(@arch@_cgen_cpu_open): Allow for lookup_mach_via_bfd_name returning
	NULL.

Index: desc-cpu.scm
===================================================================
RCS file: /cvs/src/src/cgen/desc-cpu.scm,v
retrieving revision 1.34
diff -u -p -r1.34 desc-cpu.scm
--- desc-cpu.scm	25 Jul 2016 15:39:06 -0000	1.34
+++ desc-cpu.scm	7 Apr 2017 10:15:20 -0000
@@ -606,7 +606,7 @@ lookup_mach_via_bfd_name (const CGEN_MAC
 	return table;
       ++table;
     }
-  abort ();
+  return NULL;
 }
 
 /* Subroutine of @arch@_cgen_cpu_open to build the hardware table.  */
@@ -820,7 +820,8 @@ CGEN_CPU_DESC
 	    const CGEN_MACH *mach =
 	      lookup_mach_via_bfd_name (@arch@_cgen_mach_table, name);
 
-	    machs |= 1 << mach->num;
+	    if (mach != NULL)
+	      machs |= 1 << mach->num;
 	    break;
 	  }
 	case CGEN_CPU_OPEN_ENDIAN :

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-07 10:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-07 10:30 Prevent an abort in the FRV disassembler if the target bfd name is unknown Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).