]> granicus.if.org Git - graphviz/commitdiff
grammar.y pop: [nfc] fix incorrect pop from global stack
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 6 Feb 2022 06:03:48 +0000 (17:03 +1100)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 7 Feb 2022 07:51:14 +0000 (18:51 +1100)
This function was incorrectly referencing the global stack, `S`, instead of the
stack passed in. This change is marked NFC because `pop` is only ever called
with `S` as a parameter, but it still seemed worth correcting.

lib/cgraph/grammar.y

index daa90f43224c784691e5bb327e66304be24722b5..bf47373db27b98b5c7b7b9cf1b258d9b0fc65cc5 100644 (file)
@@ -227,7 +227,7 @@ static gstack_t *push(gstack_t *s, Agraph_t *subg) {
 static gstack_t *pop(gstack_t *s)
 {
        gstack_t *rv;
-       rv = S->down;
+       rv = s->down;
        agfree(G,s);
        return rv;
 }