diff options
| author | Alastair Reid | 2018-06-30 20:21:30 +0100 |
|---|---|---|
| committer | Alastair Reid | 2018-06-30 20:23:44 +0100 |
| commit | 5361c1d65c469cf9cdaeea345c4779f9c88aad55 (patch) | |
| tree | df8cf350d262bb2afe249f01d4c62e5135c25bdc /lib | |
| parent | 38e91b0f24b3ed0f022626d059ca4186e2ec43df (diff) | |
RTS: fix replicate_bits
Fixes handling of Replicate(x, 0).
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sail.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -604,8 +604,8 @@ void replicate_bits(sail_bits *rop, const sail_bits op1, const mpz_t op2) { uint64_t op2_ui = mpz_get_ui(op2); rop->len = op1.len * op2_ui; - mpz_set(*rop->bits, *op1.bits); - for (int i = 1; i < op2_ui; i++) { + mpz_set_ui(*rop->bits, 0); + for (int i = 0; i < op2_ui; i++) { mpz_mul_2exp(*rop->bits, *rop->bits, op1.len); mpz_ior(*rop->bits, *rop->bits, *op1.bits); } |
