Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP1:GA
cross-riscv64-gcc11-bootstrap.23211
gcc11-D-dependence-fix.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gcc11-D-dependence-fix.patch of Package cross-riscv64-gcc11-bootstrap.23211
From abd47b4abea7e1463706c1132dc78d468d27bd96 Mon Sep 17 00:00:00 2001 From: Iain Buclaw <ibuclaw@gdcproject.org> Date: Mon, 26 Jul 2021 17:06:08 +0200 Subject: [PATCH] d: Insert null terminator in obstack buffers To: gcc-patches@gcc.gnu.org Covers cases where functions that handle the extracted strings ignore the explicit length. This isn't something that's known to happen in the current front-end, but the self-hosted front-end has been observed to do this in its conversions between D and C-style strings. gcc/d/ChangeLog: * d-lang.cc (deps_add_target): Insert null terminator in buffer. (deps_write): Likewise. (d_parse_file): Likewise. (cherry picked from commit b2abe4e1aded1409964b870899d18dfdb6384821) --- gcc/d/d-lang.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc index 6ad3823d910..3e6566a3689 100644 --- a/gcc/d/d-lang.cc +++ b/gcc/d/d-lang.cc @@ -108,7 +108,7 @@ deps_add_target (const char *target, bool quoted) if (!quoted) { - obstack_grow (&buffer, target, strlen (target)); + obstack_grow0 (&buffer, target, strlen (target)); d_option.deps_target.safe_push ((const char *) obstack_finish (&buffer)); return; } @@ -149,6 +149,7 @@ deps_add_target (const char *target, bool quoted) obstack_1grow (&buffer, *p); } + obstack_1grow (&buffer, '\0'); d_option.deps_target.safe_push ((const char *) obstack_finish (&buffer)); } @@ -278,6 +279,8 @@ deps_write (Module *module, obstack *buffer) obstack_grow (buffer, str, strlen (str)); obstack_grow (buffer, ":\n", 2); } + + obstack_1grow (buffer, '\0'); } /* Implements the lang_hooks.init_options routine for language D. @@ -884,6 +887,7 @@ d_parse_file (void) obstack_grow (&buffer, str, strlen (str)); } + obstack_1grow (&buffer, '\0'); message ("%s", (char *) obstack_finish (&buffer)); } } -- 2.34.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor