diff mbox

Do not allow empty argument of -o option (PR driver/31468).

Message ID 1cf5a520-ec33-e6be-3741-0d7ec23a2340@suse.cz
State New
Headers show

Commit Message

Martin Liška May 15, 2017, 9:52 a.m. UTC
Hello.

This is fix for old issues which can be still exposed.
Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Ready to be installed?
Martin

Comments

Richard Biener May 15, 2017, 11:55 a.m. UTC | #1
On Mon, May 15, 2017 at 11:52 AM, Martin Liška <mliska@suse.cz> wrote:
> Hello.
>
> This is fix for old issues which can be still exposed.
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>
> Ready to be installed?

+  if (output_file != NULL && output_file[0] == '\0')
+    fatal_error (input_location, "output file could not be empty");
+

"output filename may not be empty"

Ok with that change.

Richard.

> Martin
diff mbox

Patch

From 0cbecc941d9b53de8235d5147ee3891d57af5f49 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Wed, 3 May 2017 12:16:45 +0200
Subject: [PATCH] Do not allow empty argument of -o option (PR driver/31468).

gcc/ChangeLog:

2017-05-03  Martin Liska  <mliska@suse.cz>

	PR driver/31468
	* gcc.c (process_command): Do not allow empty argument of -o option.
---
 gcc/gcc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/gcc.c b/gcc/gcc.c
index 826b012cd77..c68eebea92f 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -4472,6 +4472,9 @@  process_command (unsigned int decoded_options_count,
 		       output_file);
     }
 
+  if (output_file != NULL && output_file[0] == '\0')
+    fatal_error (input_location, "output file could not be empty");
+
   /* If -save-temps=obj and -o name, create the prefix to use for %b.
      Otherwise just make -save-temps=obj the same as -save-temps=cwd.  */
   if (save_temps_flag == SAVE_TEMPS_OBJ && save_temps_prefix != NULL)
-- 
2.12.2