summaryrefslogtreecommitdiffstats
path: root/arith.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-06-19 23:21:39 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-06-19 23:27:48 -0700
commit9cf992835c8a0f2e6c4ace07b67fea2acb762cc5 (patch)
tree1e85935de4e6e0881de015954a76e6beb11deb0d /arith.c
parent6da59c10cb9cd59bdc04432f3f2a25df0991fac3 (diff)
downloadtxr-9cf992835c8a0f2e6c4ace07b67fea2acb762cc5.tar.gz
txr-9cf992835c8a0f2e6c4ace07b67fea2acb762cc5.tar.bz2
txr-9cf992835c8a0f2e6c4ace07b67fea2acb762cc5.zip
ash: gc problem.
On 32 bit x86 Solaris 10, with gcc 4.9.0, this issue caused a miscompilation of the pset macro, due to ash abruptly returning zero, causing the op-code field of an instruction to be NOOP rather than GCALL. I'm committing this fix just for reference; I will immediately replace it with a refactoring of the function. * arith.c (ash): Add a gc_hint to prevent the a bignum from being reclaimed if the b = make_bignum() triggers gc. This happens in the case when the previous case computes a = make_bignum() and falls through.
Diffstat (limited to 'arith.c')
-rw-r--r--arith.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arith.c b/arith.c
index fdb294b7..f374ddf4 100644
--- a/arith.c
+++ b/arith.c
@@ -3235,6 +3235,7 @@ val ash(val a, val bits)
b = make_bignum();
if ((mpe = mp_shift(mp(a), mp(b), bn)) != MP_OKAY)
break;
+ gc_hint(a);
return normalize(b);
default:
goto bad3;