Blame sagemath-use-after-free.patch
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
diff -up src/sage/graphs/graph_decompositions/cutwidth.pyx.orig src/sage/graphs/graph_decompositions/cutwidth.pyx
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
--- src/sage/graphs/graph_decompositions/cutwidth.pyx.orig 2022-01-30 06:41:50.000000000 -0700
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
+++ src/sage/graphs/graph_decompositions/cutwidth.pyx 2022-03-06 17:04:36.234711622 -0700
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
@@ -522,12 +522,12 @@ def cutwidth_dyn(G, lower_bound=0):
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
if exists(g, neighborhoods, 0, 0, i, k) <= k:
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
order = find_order(g, neighborhoods, k)
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
return k, [g.int_to_vertices[i] for i in order]
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
+
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
+ order = find_order(g, neighborhoods, k)
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
+ return k, [g.int_to_vertices[i] for i in order]
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
finally:
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
sig_free(neighborhoods)
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
- order = find_order(g, neighborhoods, k)
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
- return k, [g.int_to_vertices[i] for i in order]
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
-
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
cdef inline int exists(FastDigraph g, uint8_t* neighborhoods, int S, int cost_S, int v, int k):
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
r"""
|
|
![](https://seccdn.libravatar.org/avatar/258caf5973a37959eeea9164bfc32d49b0634d0792e85fce1f5acf0430f05ba2?s=16&d=retro) |
30bb46d |
Check whether an ordering with the given cost `k` exists, and updates data
|