From eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 Mon Sep 17 00:00:00 2001 From: Dave Cobbley Date: Tue, 14 Aug 2018 10:05:37 -0700 Subject: [Subtree] Removing import-layers directory As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley Signed-off-by: Brad Bishop --- .../fix-segmentation-fault-precompiled-hdr.patch | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 poky/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch (limited to 'poky/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch') diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch new file mode 100644 index 000000000..c0adef6f2 --- /dev/null +++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch @@ -0,0 +1,49 @@ + +Prevent a segmentation fault which occurs when using incorrect +structure trying to access name of some named operators, such as +CPP_NOT, CPP_AND etc. "token->val.node.spelling" cannot be used in +those cases, as is may not be initialized at all. + + +[YOCTO #11738] + +Upstream-Status: Pending + +Signed-off-by: Juro Bystricky + +diff --git a/libcpp/lex.c b/libcpp/lex.c +--- a/libcpp/lex.c ++++ b/libcpp/lex.c +@@ -3229,11 +3229,27 @@ + spell_ident: + case SPELL_IDENT: + if (forstring) +- { +- memcpy (buffer, NODE_NAME (token->val.node.spelling), +- NODE_LEN (token->val.node.spelling)); +- buffer += NODE_LEN (token->val.node.spelling); +- } ++ { ++ if (token->type == CPP_NAME) ++ { ++ memcpy (buffer, NODE_NAME (token->val.node.spelling), ++ NODE_LEN (token->val.node.spelling)); ++ buffer += NODE_LEN (token->val.node.spelling); ++ break; ++ } ++ /* NAMED_OP, cannot use node.spelling */ ++ if (token->flags & NAMED_OP) ++ { ++ const char *str = cpp_named_operator2name (token->type); ++ if (str) ++ { ++ size_t len = strlen(str); ++ memcpy(buffer, str, len); ++ buffer += len; ++ } ++ break; ++ } ++ } + else + buffer = _cpp_spell_ident_ucns (buffer, token->val.node.node); + break; -- cgit v1.2.1