summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-10.1/0031-fix-segmentation-fault-in-precompiled-header-generat.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-05-12 11:30:51 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-14 14:15:11 +0100
commitd8d7d9e8f07099cbb9283b28f226bd9f17f7a50b (patch)
tree62e0def09a6ec4693bd23e7eb0b2cf30b99f3b98 /meta/recipes-devtools/gcc/gcc-10.1/0031-fix-segmentation-fault-in-precompiled-header-generat.patch
parente12098a6121522c8a901397b330631ba799a0f8d (diff)
downloadpoky-d8d7d9e8f07099cbb9283b28f226bd9f17f7a50b.tar.gz
gcc10: Update to GCC 10.1 Release
* Package new gomp header acc_prof.h * Package lto-dump which is a new tool in gcc10 * All Changes are here [1] * Porting apps to gcc 10 help is here [2] * Backport a patch to fix CET errors on cross builds * Add patch to fix mingw libstdc++ [1] https://gcc.gnu.org/gcc-10/changes.html [2] https://gcc.gnu.org/gcc-10/porting_to.html (From OE-Core rev: 44c3881b18f74eb64379818fc150f94398fb8a49) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-10.1/0031-fix-segmentation-fault-in-precompiled-header-generat.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-10.1/0031-fix-segmentation-fault-in-precompiled-header-generat.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-10.1/0031-fix-segmentation-fault-in-precompiled-header-generat.patch b/meta/recipes-devtools/gcc/gcc-10.1/0031-fix-segmentation-fault-in-precompiled-header-generat.patch
new file mode 100644
index 0000000000..702279af0e
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-10.1/0031-fix-segmentation-fault-in-precompiled-header-generat.patch
@@ -0,0 +1,57 @@
1From 27b8ba5555ada2dab076988529bfb84d00a4b901 Mon Sep 17 00:00:00 2001
2From: Juro Bystricky <juro.bystricky@intel.com>
3Date: Mon, 19 Mar 2018 22:31:20 -0700
4Subject: [PATCH] fix segmentation fault in precompiled header generation
5
6Prevent a segmentation fault which occurs when using incorrect
7structure trying to access name of some named operators, such as
8CPP_NOT, CPP_AND etc. "token->val.node.spelling" cannot be used in
9those cases, as is may not be initialized at all.
10
11[YOCTO #11738]
12
13Upstream-Status: Pending
14
15Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18 libcpp/lex.c | 26 +++++++++++++++++++++-----
19 1 file changed, 21 insertions(+), 5 deletions(-)
20
21diff --git a/libcpp/lex.c b/libcpp/lex.c
22index 56ac3a1dd73..73a951148b3 100644
23--- a/libcpp/lex.c
24+++ b/libcpp/lex.c
25@@ -3311,11 +3311,27 @@ cpp_spell_token (cpp_reader *pfile, const cpp_token *token,
26 spell_ident:
27 case SPELL_IDENT:
28 if (forstring)
29- {
30- memcpy (buffer, NODE_NAME (token->val.node.spelling),
31- NODE_LEN (token->val.node.spelling));
32- buffer += NODE_LEN (token->val.node.spelling);
33- }
34+ {
35+ if (token->type == CPP_NAME)
36+ {
37+ memcpy (buffer, NODE_NAME (token->val.node.spelling),
38+ NODE_LEN (token->val.node.spelling));
39+ buffer += NODE_LEN (token->val.node.spelling);
40+ break;
41+ }
42+ /* NAMED_OP, cannot use node.spelling */
43+ if (token->flags & NAMED_OP)
44+ {
45+ const char *str = cpp_named_operator2name (token->type);
46+ if (str)
47+ {
48+ size_t len = strlen(str);
49+ memcpy(buffer, str, len);
50+ buffer += len;
51+ }
52+ break;
53+ }
54+ }
55 else
56 buffer = _cpp_spell_ident_ucns (buffer, token->val.node.node);
57 break;