diff options
| author | Stefan Eßer <se@FreeBSD.org> | 2020-08-05 10:07:43 +0000 |
|---|---|---|
| committer | Stefan Eßer <se@FreeBSD.org> | 2020-08-05 10:07:43 +0000 |
| commit | 592e97f5f6ed46b0e508b0be5511780ad9b336f6 (patch) | |
| tree | 985a3b70bd0854b1337d8111bb935824c4aec2df /src | |
| parent | a68dea2ff90f2e77fe8c6a9e022aa1ac258106b7 (diff) | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/program.c | 7 | ||||
| -rw-r--r-- | src/vm.c | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/program.c b/src/program.c index 1a8176c76f96..3c2544f8a61f 100644 --- a/src/program.c +++ b/src/program.c @@ -1271,12 +1271,13 @@ static void bc_program_divmod(BcProgram *p) { BcNum *n1, *n2; size_t req; + bc_vec_expand(&p->results, p->results.len + 2); + + // We don't need to update the pointer because + // the capacity is enough due to the line above. res2 = bc_program_prepResult(p); res = bc_program_prepResult(p); - // Update the pointer, just in case. - res2 = bc_vec_item_rev(&p->results, 1); - bc_program_binOpPrep(p, &opd1, &n1, &opd2, &n2, 2); req = bc_num_mulReq(n1, n2, BC_PROG_SCALE(p)); @@ -464,7 +464,7 @@ static void bc_vm_process(const char *text) { while (BC_PARSE_CAN_PARSE(vm.prs)) vm.parse(&vm.prs); - bc_program_exec(&vm.prog); + if(BC_IS_DC || !BC_PARSE_NO_EXEC(&vm.prs)) bc_program_exec(&vm.prog); assert(BC_IS_DC || vm.prog.results.len == 0); |
