From e3e7d653c270da8de73dbddbc80e387f8d7d5458 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 16 Jan 2019 14:10:38 +0100 Subject: gcc-arm 8.2: add recipe for ARM 2019.01 8.2.1 release Change-Id: Iae2ebc60bacd77fac49cac8f5bb97711479d4fe6 Signed-off-by: Koen Kooi --- ...ation-fault-in-precompiled-header-generat.patch | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-arm-8.2/0038-fix-segmentation-fault-in-precompiled-header-generat.patch (limited to 'meta-linaro-toolchain/recipes-devtools/gcc/gcc-arm-8.2/0038-fix-segmentation-fault-in-precompiled-header-generat.patch') diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-arm-8.2/0038-fix-segmentation-fault-in-precompiled-header-generat.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-arm-8.2/0038-fix-segmentation-fault-in-precompiled-header-generat.patch new file mode 100644 index 00000000..224d2ae6 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-arm-8.2/0038-fix-segmentation-fault-in-precompiled-header-generat.patch @@ -0,0 +1,60 @@ +From 00694849632dee23741925c6104df134f6bff747 Mon Sep 17 00:00:00 2001 +From: Juro Bystricky +Date: Mon, 19 Mar 2018 22:31:20 -0700 +Subject: [PATCH 38/39] fix segmentation fault in precompiled header generation + +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 +Signed-off-by: Khem Raj +--- + libcpp/lex.c | 26 +++++++++++++++++++++----- + 1 file changed, 21 insertions(+), 5 deletions(-) + +diff --git a/libcpp/lex.c b/libcpp/lex.c +index 37c365a3560..63480048db6 100644 +--- a/libcpp/lex.c ++++ b/libcpp/lex.c +@@ -3279,11 +3279,27 @@ cpp_spell_token (cpp_reader *pfile, const cpp_token *token, + 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; +-- +2.17.0 + -- cgit v1.2.3