aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Howard <yzena.tech@gmail.com>2021-04-02 13:23:06 -0600
committerGavin Howard <yzena.tech@gmail.com>2021-04-02 13:23:06 -0600
commit34ca7b50d1c0111a95a6bb803c105a4ddb287140 (patch)
tree71c1ed15dc2e325247ecc957ac22d46717d45fa7
parent86b5753fd8f64e9b864e28611aa790fdce2c4d5c (diff)
downloadbc-34ca7b50d1c0111a95a6bb803c105a4ddb287140.tar.gz
Fix a bug reported by a FreeBSD user
This bug was hard to find the cause of (because the reproducer was a massive dc script), but the problem was simple: the `P` was supposed to pop the top of the stack, and it did not. This commit fixes the problem.
-rw-r--r--src/program.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/program.c b/src/program.c
index 91989bf4..81d0746e 100644
--- a/src/program.c
+++ b/src/program.c
@@ -1443,6 +1443,8 @@ static void bc_program_printStream(BcProgram *p) {
size_t idx = (r->t == BC_RESULT_STR) ? r->d.loc.loc : n->scale;
bc_program_printChars(*((char**) bc_vec_item(p->strs, idx)));
}
+
+ bc_vec_pop(&p->results);
}
static void bc_program_nquit(BcProgram *p, uchar inst) {