public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: cgen@sourceware.org
Cc: Nick Clifton <nickc@redhat.com>
Subject: Prevent an abort in the FRV disassembler if the target bfd name is unknown
Date: Fri, 07 Apr 2017 10:30:00 -0000	[thread overview]
Message-ID: <20170407103010.GW16711@bubble.grove.modra.org> (raw)

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

                 reply	other threads:[~2017-04-07 10:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170407103010.GW16711@bubble.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=cgen@sourceware.org \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).