Fix issue introduced when backporting recursion limit to rust demangler
Resolves: RHEL-7330
This commit is contained in:
parent
9e868de349
commit
0d467c05d6
@ -301,3 +301,6 @@ Patch070: libiberty-infinite-recursion-fix-1-of-2.patch
|
|||||||
# (Nick Clifton)
|
# (Nick Clifton)
|
||||||
Patch071: libiberty-infinite-recursion-fix-2-of-2.patch
|
Patch071: libiberty-infinite-recursion-fix-2-of-2.patch
|
||||||
|
|
||||||
|
|
||||||
|
Patch072: libiberty-infinite-recursion-fix-3-of-3.patch
|
||||||
|
|
||||||
|
@ -69,3 +69,4 @@
|
|||||||
%patch069 -p1
|
%patch069 -p1
|
||||||
%patch070 -p1
|
%patch070 -p1
|
||||||
%patch071 -p1
|
%patch071 -p1
|
||||||
|
%patch072 -p1
|
||||||
|
@ -69,3 +69,4 @@ gdb-backport-call-check_typedef-at-beginning-of-dwarf_expr_context.patch
|
|||||||
gdb-rhbz2153228-fail-if-sh_info-is-zero.patch
|
gdb-rhbz2153228-fail-if-sh_info-is-zero.patch
|
||||||
libiberty-infinite-recursion-fix-1-of-2.patch
|
libiberty-infinite-recursion-fix-1-of-2.patch
|
||||||
libiberty-infinite-recursion-fix-2-of-2.patch
|
libiberty-infinite-recursion-fix-2-of-2.patch
|
||||||
|
libiberty-infinite-recursion-fix-3-of-3.patch
|
||||||
|
5
gdb.spec
5
gdb.spec
@ -73,7 +73,7 @@ Version: 12.1
|
|||||||
|
|
||||||
# The release always contains a leading reserved number, start it at 1.
|
# The release always contains a leading reserved number, start it at 1.
|
||||||
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
|
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
|
||||||
Release: 4%{?dist}
|
Release: 5%{?dist}
|
||||||
|
|
||||||
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL
|
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL
|
||||||
# Do not provide URL for snapshots as the file lasts there only for 2 days.
|
# Do not provide URL for snapshots as the file lasts there only for 2 days.
|
||||||
@ -1205,6 +1205,9 @@ fi
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Oct 30 2023 Guinevere Larsen <blarsen@redhat.com> - 12.1-5.el9
|
||||||
|
- Fix issue introduced when backporting the recursion limit to the rust demangler.
|
||||||
|
|
||||||
* Tue Oct 10 2023 Guinevere Larsen <blarsen@redhat.com> - 12.1-4.el9
|
* Tue Oct 10 2023 Guinevere Larsen <blarsen@redhat.com> - 12.1-4.el9
|
||||||
- Backport "Fix typo in recent code to add stack recursion limit to the Rust demangler."
|
- Backport "Fix typo in recent code to add stack recursion limit to the Rust demangler."
|
||||||
(Nick Clifton)
|
(Nick Clifton)
|
||||||
|
40
libiberty-infinite-recursion-fix-3-of-3.patch
Normal file
40
libiberty-infinite-recursion-fix-3-of-3.patch
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||||
|
From: Guinevere Larsen <blarsen@redhat.com>
|
||||||
|
Date: Mon, 30 Oct 2023 12:48:01 +0100
|
||||||
|
Subject: libiberty-infinite-recursion-fix-3-of-3.patch
|
||||||
|
|
||||||
|
fix backport error in patch 1 of this series.
|
||||||
|
|
||||||
|
diff --git a/libiberty/rust-demangle.c b/libiberty/rust-demangle.c
|
||||||
|
--- a/libiberty/rust-demangle.c
|
||||||
|
+++ b/libiberty/rust-demangle.c
|
||||||
|
@@ -1082,6 +1082,18 @@ demangle_path_maybe_open_generics (struct rust_demangler *rdm)
|
||||||
|
if (rdm->errored)
|
||||||
|
return open;
|
||||||
|
|
||||||
|
+ if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
|
||||||
|
+ {
|
||||||
|
+ ++ rdm ->recursion;
|
||||||
|
+ if (rdm->recursion > RUST_MAX_RECURSION_COUNT)
|
||||||
|
+ {
|
||||||
|
+ /* FIXME: there ought to be a way to report
|
||||||
|
+ that the recorsion limit has been reached. */
|
||||||
|
+ rdm->errored = 1;
|
||||||
|
+ goto end_of_func;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (eat (rdm, 'B'))
|
||||||
|
{
|
||||||
|
backref = parse_integer_62 (rdm);
|
||||||
|
@@ -1107,6 +1119,10 @@ demangle_path_maybe_open_generics (struct rust_demangler *rdm)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
demangle_path (rdm, 0);
|
||||||
|
+ end_of_func:
|
||||||
|
+ if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
|
||||||
|
+ -- rdm->recursion;
|
||||||
|
+
|
||||||
|
return open;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user