aboutsummaryrefslogtreecommitdiff
path: root/gcc/d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/d')
-rw-r--r--gcc/d/d-lang.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc
index ef0fe0b..b7c8685 100644
--- a/gcc/d/d-lang.cc
+++ b/gcc/d/d-lang.cc
@@ -1077,6 +1077,10 @@ d_parse_file (void)
global.params.dihdr.doOutput);
modules.push (m);
+ /* Zero the padding past the end of the buffer so the D lexer has a
+ sentinel. The lexer only reads up to 4 bytes at a time. */
+ memset (buffer + len, '\0', 16);
+
/* Overwrite the source file for the module, the one created by
Module::create would have a forced a `.d' suffix. */
m->src.length = len;