arnaucube
arnaucube/circomPublic Self-hosted repository
Fix Offset referenced by an iteger
Jordi Baylina jordi@baylina.cat
Mon, 17 Aug 2020 11:22:21 +0200
commit

2e1b35a94de0c4f2462fe2aad711013304647c86

parent

7cef1be2c3bf2bf50415986c7af1726ee685510c

1 files changed, 9 insertions(+), 1 deletions(-)

jump to
M src/gencode.js → src/gencode.js

@@ -723,7 +723,15 @@ }

if (instantiated) { if (offset.used) { - ctx.codeBuilder.copyN(left.label, ["R", offset.label], ["R", right.label], right.sizes[0]); + let ot; + if (offset.type == "BIGINT") { + ot = "R"; + } else if (offset.type == "INT") { + ot= "RI"; + } else { + assert(false); + } + ctx.codeBuilder.copyN(left.label, [ot, offset.label], ["R", right.label], right.sizes[0]); } else { ctx.codeBuilder.copyN(left.label, ["V", offset.value[0]], ["R", right.label], right.sizes[0]); }